How to rename your computer using it’s service tag number
Below is a short script that is handy in renaming your computer using the service tag or serial number of the machine. To invoke this on multiple machines you may want to look into running psexec to copy the script locally to the machine, then run and finally reboot the machine.
wmic bios get serialnumber | find /I /V “SerialNumber” > “%temp%\sn.txt”
set /p comp_name=<“%temp%\sn.txt”
wmic computersystem where name=”%computername%” rename name=%comp_name%