Edit Active Directory Description Script

Comments

5 comments

  • Brad Dees

    I would like to accomplish somewhat of the same thing. Except I would like to take the AD Description and updated the computer Description.  I don't know if it would be better to query AD for the description or get it from PDQ Inventory.  Anyone got an example of the best way to update the computer Description to match the AD Description?

    0
    Comment actions Permalink
  • Bryan

    I would try using reg.exe (http://technet.microsoft.com/en-us/library/cc732643.aspx) or RegJump (http://technet.microsoft.com/en-us/sysinternals/bb963880.aspx) to edit manually.

    The key you want to edit is located here:

    HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\LanmanServer\Parameters

    You may have to create a new string value (REG_SZ) names srvComment.

    0
    Comment actions Permalink
  • Martin

    Recently I had a similar task at hand and I solved it with a small Powershell script. It's a quick 'n dirty solution that works without RSAT.

    I used PQD Deploy to run it on clients. Worked like a chram.

    0
    Comment actions Permalink
  • Sam_IT-Admin

    Here is a VBS script I use to add the Admin, Serial Number, Model Number, Update Time to the AD Description. I run it in the Admin Context, as my users don't have the permissions in AD to update the field. (Which you can enable if you wish). If your users do have that ability, this script has the ability add the 'Logged in user' (objUser) to the description. Helpful to easily be able to see which PCs are assigned to which user when browsing AD.  Since I can't do that, I just set Admin = John Doe.

    On Error Resume Next
    strComputer = "."
    Set objWMIService = GetObject("winmgmts:" _
        & "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
    Set colcomputersystem = objWMIService.ExecQuery _
        ("Select * from Win32_computersystem")
    Set colBIOS = objWMIService.ExecQuery _
        ("Select * from Win32_BIOS")
    For each objcomputersystem in colcomputersystem
        Getcomputersystem = objcomputersystem.Model
    Next
        For each objBIOS in colBIOS
    GetSerialNumber = objBIOS.SerialNumber
        Next       
    Set objSysInfo = CreateObject("ADSystemInfo")
    Set objUser = GetObject("LDAP://" & objSysInfo.UserName)
    Set objComputer = GetObject("LDAP://" & objSysInfo.ComputerName)
    strMessage = "Admin: John Doe / SN: " &  GetSerialNumber & " / Model: " & Getcomputersystem & " / Update Time: " & right(year(now()),4) & "." & month(Now()) & "." & Day(now()) & " @ " & Time
    objComputer.Description = strMessage
    objComputer.SetInfo
    0
    Comment actions Permalink
  • Christian Bacher

    Or just use cmd for a quick entry:

    net config server /srvcomment:"put_your_comment_here"

    0
    Comment actions Permalink

Please sign in to leave a comment.