I wish to populate the local machine description (overwrite if already present) with the Model of the computer. Is there some sort of script that can perform this task for me? I have found a site that has some code but they dont have a solution. i have very little knowledge of vb script. but if there is anyway of doing this that would be great.
Thanks
Assuming your looking to change the computer description on the local machine itself, and not in Active Directory - you could do the following with Powershell (note: you'll need powershell on your XP clients).
$computer=get-wmiobject win32_computersystem
Set-ItemProperty -path "HKLM:\SYSTEM\CurrentControlSet\Services\LanManServer\Parameters" -name "srvcomment" -value $computer.model
I looked for more elegant methods to update the computer description, but none of them actually worked. Updating the registry entry appeared to be the easiest method.
Assuming powershell doesn't work, you may want to look into a scripting language called AutoIT. AutoIt can compile everything into a self contained executable and eliminate client dependancies.
Standing on the shoulders of the excellent answer by CurtM, I have a non-powershell approach. Call this script from a logon script:
setmodel.cmd
With minor modifications, you can process a list of machines in the domain:
setmodel_r.cmd
Get a list of machines in the domain using dsquery.exe. Pipe the output to setmodel_r.cmd and you should have your model set as the description. From a command prompt, issue the command:
But, you may want to test the setmodel_r.cmd before running it against your entire domain-
where testcomputers.txt contains several machine names, each on a new line.
You should play with these until you become comfortable with what they do.
Rob