I am a moderate PowerShell user and am having some issues trying to get some device information from Azure AD by using devices set for Enrollment in Intune
There are device properties that can be used to setup Dynamic Groups in Azure AD / Intune. When setting up a group to pull machines using Purchase Order info, the query is
<p style=“margin: 0in; font-family: Calibri; font-size: 11.0pt;”>(device.devicePhysicalIds -any _ -eq “[PurchaseOrderId]:76222342342”)</p>
I am trying to use this information somehow with PowerShell to pull a list of all machines with a particular purchase order and then add them to an AAD group I specify. The AAD groups are already created and are manual groups, so I cant use a new Dynamic Group to do this…
I have tried using Get-AzureADDevice with a -Filter but cant seem to get a query to work with the filter, and if the query works, I dont know if the properties are even usable.
Just not sure how I can use those query values in PowerShell to get the information I want, if I can at all…
Thanks for any assistance.