Get/Set ComputerName datafile + variable use
We have a IT policy that says the computer names should be set to "LT/PC-Serialnumber" depending on if it's a laptop or a stationary computer.
Currently we're manually setting the LT/PC part with the setcomputername /dialog, with get-computername that is grasping the serialnr for us, but with an extra "D" in front of the serialnr for some reason.
It would be awesome to have this fully automatic, after checking the recent get/setcomputername version i found that you can use a datafile. Tried using a datafile that checks for the model to decide if it's a laptop or stationary and therafter using $serial, which seems like a no go, see below.
Running set computername like; setcomputername.exe /rdf:computernames.txt /dfk:$Model
Having only this in my test computernames.txt;
OPT 790 = PC-$Serial
Has anyone managed to set up something similar? Any tips would be appreciated!
I'm sorry if the explanation isn't the best. I'll try explaining myself further if needed.
Please log in to answer
Posted by: Xacken 5 years ago