This article provides steps to get a list of Office 365 ImmutableID's using PowerShell. This is useful when there are immutableID mismatches that can cause provisioning issues from Okta to Office 365.
This article is based on a Microsoft product, PowerShell. We suggest contacting Microsoft support if assistance is required with PowerShell and the immutableID.
- Office365 (O365 / M365) provisioning
- Azure/MS PowerShell/Windows machine
- Okta Integration Network (OIN)
Follow the steps below:
- Read and install the required software on the machine as described in Microsoft Documentation: Connect with the Microsoft Azure Active Directory Module for Windows PowerShell.
-
Launch PowerShell as an Administrator.
-
Install the Microsoft Graph PowerShell SDK module: Install-Module Microsoft.Graph.
-
Wait for the package to install, then type the following to enter Office 365 admin credentials and connect to Azure Active Directory via PowerShell: Connect-MgGraph -Scopes
User.Read.All. -
Run the following command to get immutableIDs for all users:
Get-MgUser -All | Select-Object DisplayName, UserPrincipalName, OnPremisesImmutableId
-
Run the following command to get immutableID for a specific user:
Get-MgUser -UserId "user@yourdomain.com" | Select-Object DisplayName, UserPrincipalName, OnPremisesImmutableId
