PowerShell script to rename Windows devices
As an IT administrator, there could be several reasons why you might want to rename your Windows devices. For instance, you might want to assign familiar and identifiable device names that adhere to your organization’s asset naming convention. Hexnode enables administrators to rename Windows devices on multiple devices using custom scripts simultaneously.
Rename Windows devices
Write-Host "Changing device name to:"$deviceName
Rename-Computer -NewName $deviceName
Write-Host "Please provide device name as argument"
When executing the script, pass the device name to be assigned to the device as Arguments. You can also pass the argument using the wildcards supported by Hexnode, which can be very convenient when simultaneously deploying the script to multiple devices in bulk.
For example, provide the argument as %assettag% to change the device name to its asset tag number as provided in the device summary page in the Hexnode portal.