Rename devices with PowerShell and Microsoft Intune
Renaming a device manually is quick and easy when we only have one device to fix. But when it comes to doing a large number of devices, then it is better to automate this action. Today, there is the method via CSP but which can have a rather random behavior, in particular on the reporting, console side. I therefore share with you a PowerShell script which, deployed with Microsoft Intune, will allow you to quickly rename your machines. Script overview This script detects the type of device used: If it's a virtual machine , it takes the defined prefix (CCMT in my example) and adds a numeric complement generated with Get-Random command For physical machines , it retrieves the serial number and adds the prefix (CCMT in my example) The user is informed that his device has received changes and that it will restart automatically in a few minutes. The script is available on Github : Link Script integration & deployment Prerequisites The prerequisites are: Conve...