Forum Discussion

L_Cabangon's avatar
L_Cabangon
Copper Contributor
Nov 07, 2022

Create a dynamic device group based on registered owner or primary user UPN?

Most of our users have the UPN say *@abc.com, but about 10% have the *@xyz.com. Basically the goal of the dynamic group is to add devices where the registered owner or primary user have the UPN *@xyz.com. Is there a way to do that?

 

I found a close reply here, where the solution was to use physicalIDs, but is there a way to use a wildcard UPN like *@xyz.com?

2 Replies

  • JanRezab's avatar
    JanRezab
    Brass Contributor
    For this purpose, I use a PowerShell script that runs from the Azure Automation account.

    The script handles this using the graph API.
    • JanRezab's avatar
      JanRezab
      Brass Contributor

      I can't share our script, but you can check this one https://github.com/microsoftgraph/powershell-intune-samples/blob/master/ManagedDevices/ManagedDevices_Add_ToAADGroup.ps1 for inspiration.

Resources