Locate extension attributes for users

The optional attributes that School Data Sync (SDS) can sync for users are stored on each individual user in Microsoft Entra ID as Extension Attributes. Extension Attributes for Users can be located utilizing PowerShell and Graph. You can also use the PowerShell for Microsoft Graph module see Groups and Administrative Unit extension Attributes (not covered in this article).

First confirm the proper PowerShell module for Microsoft Graph is installed. Instructions can be found here: PowerShell For SDS.

Selecting a user

To locate a single users extension attribute, you must first locate their Object/Graph ID. Selecting a user can be done a few different ways. Full details can be found here: Get-MgUser.

Example 1: Get all users on tenant.

Get-MgUser -All | Format-List ID, DisplayName, Mail, UserPrincipalName

Example 2: Get a user by ID.

Get-MgUser -Search 'firstName.lastName@contoso.com' | Format-List ID, DisplayName, Mail, UserPrincipalName

Example 3: Get a user by Display Name value.

Get-MgUser -Search 'firstName' | Format-List ID, DisplayName, Mail, UserPrincipalName

Viewing extension attributes

You can use the ID of the user you located prior or a combination of commands, to return the list of extension attributes. Full details of one of the commands used can be found here: Get-MgUserExtension

Example 1: Get extension attributes of a single user with ID.

Get-MgUserExtension -UserId <String>

Example 2: Get extension attributes of all users on tenant.

$UserId = (Get-MgUser -All).UserId
foreach ($Object in $UserId) {Get-MgUserExtension -UserId $Object}

Example 3: Get extension attribute with Get-MgUser by Display Name value.

Get-MgUser -Search 'firstName' | Select-Object -ExpandProperty ExtensionProperty