Forum Discussion
Create dynamic device group based off of which user enrolled the device
Is there a way to create a dynamic device group based off of which user enrolled the device? For example, I have an admin account that enrolled a bunch of kiosk machines, and I want the group to consist of all the devices that were enrolled by that account. (It might just be me being dense, but I can't for the life of me figure out how to do this based off Microsoft's documentation.)
Hi skythrock,
From my understanding, it wasn't possible to create a dynamic group based on which users enrolled the device into Azure AD. But I did some research via the Graph API and I have found a solution. And that the physicalIds field in Azure AD contains USER-GID information. So this means that you can build a dynamic query on that.
The only thing you need is the ID of your admin account. So go to Azure AD -> Users -> Admin account-> Copy userid from address barSo, you have all the needed information and you use create a dynamic group with the following Dynamic query and you will get all Azure AD devices that have been enrolled with your admin account.
device.devicePhysicalIDs -any _ -contains "[USER-HWID]: <ID of your Admin account> "
OR
device.devicePhysicalIDs -any _ -contains "[USER-GID]:<ID of your Admin account>"
Hopefully, this will help you.
Kind regards,
Rene
- Mr_HelaasSteel Contributor
Hi skythrock,
From my understanding, it wasn't possible to create a dynamic group based on which users enrolled the device into Azure AD. But I did some research via the Graph API and I have found a solution. And that the physicalIds field in Azure AD contains USER-GID information. So this means that you can build a dynamic query on that.
The only thing you need is the ID of your admin account. So go to Azure AD -> Users -> Admin account-> Copy userid from address barSo, you have all the needed information and you use create a dynamic group with the following Dynamic query and you will get all Azure AD devices that have been enrolled with your admin account.
device.devicePhysicalIDs -any _ -contains "[USER-HWID]: <ID of your Admin account> "
OR
device.devicePhysicalIDs -any _ -contains "[USER-GID]:<ID of your Admin account>"
Hopefully, this will help you.
Kind regards,
Rene
- adrian-erwCopper Contributor
Mr_Helaas From my findings this only shows the Windows enrolled devices, not the mobile 'iphone' or 'Android' devices. Is there something I am doing wrong?
- Mr_HelaasSteel Contributor
Hi adrian-erw, what dynamic query are you using?
- tmonse970Copper Contributor
Mr_Helaas
I have been looking at this post, I have about the same issue, but I would like to add devices into a group if user is member of another group. I have been trying to use this user.memberof -any (group.objectId -in ['groupId', 'groupId']) But not sure If I can mix a lookup of users into a dynamic device group
- Jannik_ReinhardIron ContributorYou can fill a static group with help of an Azure Automation Runbook and a powershell script. I think for dynamic groups there is no attribute with which you can filter on the enrollment user.
- UpToUCopper ContributorWe are using different Scope Tag for Kiosk Machines