I do something similar but prefer setting the description from AD but do provide the ability to set it on the local workstation (in my case AD will override the one set on the local machine). I also like to show the description and the machines serial number (Dell Service Tag in my case) to the user when they hit CTRL-ALT-DEL.
Here's what I use via Group Policy system script:
option explicit
On error resume next
Dim objShell, objADSysInfo
Set objShell = CreateObject("WScript.Shell")
Set objADSysInfo = CreateObject("ADSystemInfo")
'These are the registry keys for the description broadcast in Network Neighborhood
'and for the caption/title bar shown when hitting ctrl-alt-del
Dim strRegSrvComment, strRegWelcome, strLocalDescription
strRegSrvComment = "HKLM\System\CurrentControlSet\Services\lanmanserver\parameters\SrvComment"
strRegWelcome = "HKLM\Software\Microsoft\Windows NT\CurrentVersion\WinLogon\Welcome"
strLocalDescription = objShell.RegRead(strRegSrvComment)
'Get the Active Directory Distinguished name for the current computer
Dim strADComputer, strLocalComputer
strADComputer = objADSysInfo.ComputerName
strLocalComputer = objShell.ExpandEnvironmentStrings("%COMPUTERNAME%")
objShell.LogEvent 0,"Starting CompDescription Sub: " & strADComputer & " " & strLocalComputer
'Get the Active Directory Object for the current computer
Dim objADComputer, strADDescription
Set objADComputer = GetObject("LDAP://" & strADComputer)
strADDescription = objADComputer.Description
'Get the Local Object for the current computer
Dim objLocalComputer, colEncl
Set objLocalComputer = GetObject("winmgmts:\\" & strLocalComputer & "\root\cimv2")
Set colEncl = objLocalComputer.ExecQuery("Select * from Win32_SystemEnclosure",,48)
'Get the system serial number must be less than seven chars (Dell is usually 7 exactly unless really old then its 5)
Dim objEncl
For Each objEncl in colEncl
If Len(objItem.SerialNumber) <= 7 Then
strSerialNumber = objItem.SerialNumber
End If
Next
'Compare the Active Directory description with the Local computer description
If LCase(strADDescription) <> LCase(strLocalDescription) Then
'if the descriptions don't match we've got a change.
objShell.LogEvent 0,"AD and Local description do not match" & strADDescription & " " & strLocalDescription
If strADDescription <> "" Then
objShell.LogEvent 0,"Setting Local Description to the one in AD: " & strADDescription
objShell.Run "net config server /srvcomment:" & Chr(34) & strADDescription & Chr(34)
strDescription = strADDescription
Else
objShell.LogEvent 0,"Setting AD Description to the one from the system: " & strLocalDescription
objADComputer.Put "description",strLocalDescription
objADComputer.SetInfo
strDescripton = strLocalDescription
End If
'Since we have a change in Description lets reflect that on the CTRL-ALT-DEL screen so the user
'can see our hard work which will be the logon caption bar text:
'Windows Security | ComputerName | Description ------if the serial number is in the computername
'Windows Security | Computername | Serial Number | Description ------if the serial isn't in the compname
If InStr(strLocalComputer,strSerialNumber) = 0 Then
objShell.RegWrite strRegWelcome,"| " & strLocalComputer & " | " & strSerialNumber & " | " & strDescription
Else
objShell.RegWrite strRegWelcome,"| " & strLocalComputer & " | " & strDescription
End If
End If
'cleanup
Set objADComputer = Nothing
Set objLocalComputer = Nothing
Set objEncl = Nothing
Set objShell = Nothing
Set objADSysInfo = Nothing