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:

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.


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:

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:

Happy automating!!

Leave a Comment