Automating Intune Device Documentation in IT Glue

As we continue to shift the management of devices to Intune, I wanted an easy way to see all of the devices across all customers. I wanted to include metadata at a multi-tenant level such as device compliance and autopilot enrollment. I created a script that creates a new flexible asset in IT Glue and populates it with all enrolled devices per company. The script creates new devices or updates existing devices. You will be able to document the following:

  • Device Name

  • Ownership (Corporate or Personal)

  • OS

  • OS Version

  • Compliance State

  • User

  • Autopilot Enrolled

  • Encrypted

  • Serial Number

  • Configurations(if existing)

Prerequisites

You will need to garner tokens and GUIDs from both the Secure Application Model and Syncro. The secure application model allows for a headless connection into all of your customer environments. The script to run that can be found from Kelvin over at CyberDrain. Click here to go to that page in Github.

In IT Glue you will need to create a new API Key. Click Here for IT Glueโ€™s Documentation on generating a new API key.

In Microsoft, you will need to make sure you add the following permissions from the ap that was created with the Secure Application model if they are not already there:

  • DeviceManagementConfiguration.Read.All

  • DeviceManagementManagedDevices.Read.All

Reference the following documentation for steps on adding permission to your app registration.

The Script

Final Thoughts

The script is looking for Serial Numbers to soft match an Intune enrolled device to an existing configuration and add them as a tag to the asset. I did have the thought of creating Intune devices as new configurations if they didnโ€™t perform that soft match of the serial number but would want some feedback on that! Additionally, if you think there would be more metadata you would like to see that is part of the device, please comment that below.

Last updated