Sysprep Computer Name Serial Number
I wrote a program a while back (has two years flown by already?) that does an automatic computer rename. Where Is The Serial Number On A Kel Tec 380 on this page. It's called 'compname' (original, huh?) and you can get it from www.willowhayes.co.uk. This can generate a name by pulling information from many sources, including the SMBIOS serial number. $Serial does not return anything until you assign it a value. You can perform a WMI call to get the serial number. $Serial = Get-WMIObject -Class 'Win32_BIOS' Select -Expand SerialNumber. Then your Rename-Computer cmdlet should work fine (you do not need the parenthesis around $Serial, though it.
Text [cmdletBinding()] param ( [string]$ComputerName, [string]$tag, [string]$prefix = 'abc' ) $NewName = '$($prefix)-$($tag)' Rename-Computer -ComputerName $ComputerName -NewName $NewName -DomainCredential Domain01 Admin01 -Force -Restart -whatif Save as Rename-MyComputer. Ge Refrigerator Serial Number La649910. ps1 Change the 'abc' to 'desired prefix' Execute as. Rename-MyComputer.ps1 -ComputerName 'oldcomputername' -tag 'serviceTag' delete -whatif to make the command actually work. Delete the -restart if you don't want it to firce a restart. But you might need to to get things to work properly. Disclaimer: I have not tested this in any way.