Script to report tenant devices

image

I have created a script that uses the Microsoft Graph to report devices for the tenant as shown above. You’ll find it here:

https://github.com/directorcia/Office365/blob/master/graph-devices-get.ps1

along with the documentation here:

https://github.com/directorcia/Office365/wiki/Report-tenant-devices

You will need to have the Microsoft Graph PowerShell module installed and up to date.

image

The first time you run the script you maybe prompted to login to your tenant and then you may also be asked to provide permissions as shown above. This script requires:

Device.Read.All

which you may need to consent to the first time.

After the script executes you should see an output as shown above showing the device, device id, operating system and tenant join type.

You can also use the –csv command line option to put the results to a CSV file in the parent directory.

Leave a comment