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
@for /f " skip=1 tokens=1 delims=^|" %%a in ('wmic.exe path win32_computersystem get model' ) do set model=%%a @reg add HKLM\SYSTEM\CurrentControlSet\Services\lanmanserver\parameters /v srvcomment /t reg_sz /d "%model%" /f
With minor modifications, you can process a list of machines in the domain:
setmodel_r.cmd
@for /f " skip=1 tokens=1 delims=^|" %%i in ('wmic.exe /node:%1 path win32_computersystem get model' ) do set model=%%i @reg add \\%1\HKLM\SYSTEM\CurrentControlSet\Services\lanmanserver\parameters /v srvcomment /t reg_sz /d "%model%" /f
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:
for /f %b in ('dsquery * domainroot -filter "(objectCategory=computer)" -attr name') do call setmodel_r.cmd %b
But, you may want to test the setmodel_r.cmd before running it against your entire domain-
for /f %b in (testcomputers.txt) do call setmodel_r.cmd %b
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