When performing a ‘Fresh Start’ or ‘Factory Reset’ on an Intune managed device, the computername is reset to the default ‘DESKTOP-<random>’ name.
Our requirement however, was that every machine has a specific computername.
Since Intune offers the possibility of deploying Powershell scripts, I’ve written one that checks the device’s serial number and renames the computer if the serial is known.