Important Notice: On February 29th, this community was put into read-only mode. All existing posts will remain but customers are unable to add new posts or comment on existing. Please feel to join our Community Discord for any questions and discussions.

Edit Active Directory Description Script

I'm not sure if this is the right section for this, but I thought I would share.

After searching ad nauseam, I managed to piece together a script that allows me to edit the AD Description field using custom tools in PDQ Inventory. Most credit goes to this site for getting me started:

I use the field to track location so I can see it in the main display of each collection in PDQ. Obviously you can edit this with your own criteria. Just create a .bat file with "Edit_AD_Description.vbs %Target%" and run it as a custom tool.



Date Votes
  • 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?

  • I would try using reg.exe ( or RegJump ( to edit manually.

    The key you want to edit is located here:


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

  • 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.

  • 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
        For each objBIOS in colBIOS
    GetSerialNumber = objBIOS.SerialNumber
    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
  • Or just use cmd for a quick entry:

    net config server /srvcomment:"put_your_comment_here"