Get assignments of an device via Powershell

Via the MEM UI in the device overview you can see all assignments of a certain device. In the service release Service release 2206 even the function to see the group members of a device was included. But if you want to create automations it is helpful to be able to query this information with PowerShell. I have created a script at the request of a user in the community which returns this information to you.

How do I get the script

You can find the script in my Github repository. In addition to that I have also published the script in the PowerShell Gallery. Here you can download the script with the following command.

Install-Script -Name Get-AllDeviceAssignments

What does the script deliver

General device informations

Group memberships

Configuration profiles

Applications

3 thoughts on “Get assignments of an device via Powershell

  1. Thanks for that – can it work with “nested groups” as it isn’t picking up all the assignments for my tenant. For example, device is a member of “Staff 121 Devices” and then this is a member of “All Intune Devices”. There are some apps and profiles delivered to the “top level” group.

    Like

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 )

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