Active Directory Computer Description property

(imported topic written by cstoneba)

Does anyone know of an easy way to pull the Active Directory Computer Description? I would like it to be a property within the console

(imported comment written by cstoneba)

anyone…?

(imported comment written by pmullins91)

cstoneba

anyone…?

This might be a start. IIRC the dstools are part of the Win2K3 Server admin pack.

C:\WINDOWS\system32 > whoami NT AUTHORITY\SYSTEM   C:\WINDOWS\system32 > dsquery computer -name <PC-Name-Here> | dsget computer -desc desc foo dsget succeeded   C:\WINDOWS\system32 >

(imported comment written by MattBoyd)

I can’t come up with an easy way to retrieve the description using relevance or wmi. I searched the registry and didn’t come up with the description, so I don’t think it’s stored locally on the client. However, you can retrieve the local computer’s description by using Win32_OperatingSystem or through the registry. If you use a script to regularly sync the AD computer object description with the local computer description, you could make this work.

With a little bit of googling and tinkering, I think you could create workaround. Here is how I would go about it:

  1. Write a vbscript that queries Active Directory for the description of the computer object and sets the local computer description to it. You will probably be able to find bits and pieces of this by Googling.

  2. Create a task that runs this script. Create an action that runs the script daily on all Windows machines.

  3. Retrieve the description from registry using relevance. Retrieve the value “srvcomment” from from \HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\LanmanServer\Parameters

(imported comment written by cstoneba)

Thanks for the info. Boyd, I think the solution you suggested is the only solution. I can retrieve the description with what pmullins suggested, but as we all know, those actions would not work in a property.

string values of selects (“DS_description from DS_Computer where DS_Name=’” & (computer name) & “’”) of wmi “root\directory\ldap”

1 Like