Get list of intune managed devices

I used to use scripts from the microsoft graph powershell intune samples, but getting a list of all intune managed devices took a long time and automation was a pain in the (you know what). That was, until I started using the Microsoft.Graph.Intune module.

Though, once your organisation goes over 1000 devices, you might get some results that make you wonder. If you run this command

Get-IntuneManagedDevice

You might get the above result. You can get a result of the devices by changing the command to this:

(Get-IntuneManagedDevice).Value

But that will only get you the result of the 1000 devices. If you want to get a list of all your devices, you better run this command:

Get-IntuneManagedDevice | Get-MSGraphAllPages

Once you get the list of all your devices, you can filter on all the properties of the objects returned:

So if you want to get a list of all Windows devices, you can run:

Get-IntuneManagedDevice | Get-MSGraphAllPages | Where { $_.operatingSystem -EQ "Windows" }

This time there is no complete script to download, as the commands are all in this blog post. Have fun scripting!

If you like this blog post and want to support me so I can create and share more scripts, please consider donating to me through PayPal.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s