Can I use ExtentionAttributes in Entra ID to tag the devices with different locations like 100 devices from US and 100 from UK and 100 from India? Also, How I can do this automatically as and when the device is autopilot enrolled to Intune? Can it be ba

Mytoast Admin 285 Reputation points
2025-04-27T14:58:30.3833333+00:00

Can I use ExtentionAttributes in Entra ID to tag the devices with different locations like 100 devices from US and 100 from UK and 100 from India?

Also, How I can do this automatically as and when the device is autopilot enrolled to Intune? Can it be based on device or user location which we will setup in M365 portal during user creation process or how it is?

Microsoft Intune Enrollment
Microsoft Intune Enrollment
Microsoft Intune: A Microsoft cloud-based management solution that offers mobile device management, mobile application management, and PC management capabilities.Enrollment: The process of requesting, receiving, and installing a certificate.
1,487 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Catherine Kyalo 1,305 Reputation points Microsoft Employee
    2025-04-28T13:14:40.2966667+00:00

    Hi Mytoast Admin,

    From my understanding, you are looking to automatically create and use ExtensionAttributes on devices based on user locations M365 portal during user creation during auto-enrollment.

    The answer to this is Yes, you can achieve this using Graph SDK:

    Below are the steps:

    • Find all registered devices with the Get-MgDevice cmdlet.
    • For each device, extract the identifier for the user’s account. This is stored in an odd manner in the device record (at least, Microsoft could make it much simpler to find and use the identifier).
    • Use the Get-MgUser cmdlet to check the identifier against Entra ID and retrieve user details if a match is successful. The lookup fails if the user is no longer in Entra ID or their account belongs to another tenant (Entra ID can register devices for guest users).
    • Run Update-MgDevice to populate the extension attributes when we have an account match.

    If you find the answer above helpful, please Accept the answer to help anyone in the community who might have a similar question to quickly find the solution.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.