Automating Intune corporate device identifiers

If you deal with Teams Rooms devices, you will no doubt have come across device identifiers as a way of specifying certain devices to enroll as corporate rather than personal.

This post won’t cover what they are or how to manually add them as that is well covered on the Microsoft site:

https://learn.microsoft.com/en-us/mem/intune/enrollment/corporate-identifiers-add

Instead we will look at automating them, starting with adding quickly via serial and then moving on to keeping the description updated with the make and model of the device without having to manually enter it.

Both of these scripts support app registration via either parameter, or hard-coded and require only these permissions so you can lock down significantly.

DeviceManagementServiceConfig.Read
DeviceManagementConfiguration.Read.All

Adding Devices

The first script adds the devices into Intune, but first it checks that the device doesn’t already exist. It then adds the serial number with a stock description to save input.

The serial can be added via a command line parameter or using the popup form and it accepts multiple serials separated via comma

You can find the script on GitHub here:

https://github.com/andrew-s-taylor/public/blob/main/Powershell%20Scripts/Intune/add-device-identifier.ps1

Updating Descriptions

Now you have your devices in, wouldn’t it be great if the descriptions automatically configured themselves! For that we have the second script.

This grabs the device details from Intune (by serial) and extracts the Manufacturer and Model. It then queries the description and if it doesn’t find a match, sends an update to Graph. This way it can be run in a runbook and simply left to tidy up on a fixed schedule (it can also be run ad-hoc)

This script can be found here:

https://github.com/andrew-s-taylor/public/blob/main/Powershell%20Scripts/Intune/update-device-identifier-automatic.ps1

Happy automating!!

Leave a Comment