I’m looking to create a PS script that renames a Dell workstation(s) in the following format MODELNumber-SERVICETAG (eg. E5570-123ABC1). I have managed to retrieve the service tag using the following command;
I’m unsure how to retrieve just the model number and then put that information before the service tag. I would also like to seperate this with a hyphen.
I’m a novice with PS and any help will be much appreciated with creating a rename workstation script.
Thanks for your reply, I get the following message when I test the script;
PS R:> $SerialNo = (Get-CimInstance -ClassName CIM_BIOSElement).SerialNumber
$ModelNo = (Get-CimInstance -ClassName CIM_ComputerSystem).Model.Split(’ ').[1]
$NewDellWorkstationName = $ModelNo + ‘-’ + $SerialNo
The term ‘Get-CimInstance’ is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
At line:1 char:29
The term 'Get-CimInstance' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
At line:2 char:28