User Identity is blank

JayPenney 0 Reputation points

Install the Azure AD PowerShell module if it's not already installed

Install-Module -Name MSOnline

Connect to your Azure AD tenant


Replace "" with the email address of the user you want to find

$user = Get-MsolUser -UserPrincipalName ""

Display the Identity field for the user

Write-Host "User Identity:" $user.Identity

and now at the end of that chain here is the copy/paste

PS C:\Windows\system32> Write-Host "User Identity:" $user.Identity

User Identity:

PS C:\Windows\system32>

User Identity is blank...

Hybrid environment, using global admin trying to find my User Identity.

In Entra admin, on the user page under overview - I see an "On-premises immutable ID" that looks good - but does not work

Microsoft Exchange Online Management
Microsoft Exchange Online Management
Microsoft Exchange Online: A Microsoft email and calendaring hosted service.Management: The act or process of organizing, handling, directing or controlling something.
4,166 questions
Microsoft Exchange Hybrid Management
Microsoft Exchange Hybrid Management
Microsoft Exchange: Microsoft messaging and collaboration software.Hybrid Management: Organizing, handling, directing or controlling hybrid deployments.
1,875 questions
Windows Server PowerShell
Windows Server PowerShell
Windows Server: A family of Microsoft server operating systems that support enterprise-level management, data storage, applications, and communications.PowerShell: A family of Microsoft task automation and configuration management frameworks consisting of a command-line shell and associated scripting language.
5,355 questions
Microsoft Entra ID
Microsoft Entra ID
A Microsoft Entra identity service that provides identity management and access control capabilities. Replaces Azure Active Directory.
19,394 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Marcin Policht 9,505 Reputation points MVP
    1. Make sure that the is a valid Entra ID user account
    2. Stop using the MSOnline module (it's deprecated). Use MSGraph instead.
    # Connect to Microsoft Graph
    # Get user by User Principal Name (UPN)
    $user = Get-MgUser -UserPrincipalName ""

    This will retrieve the user object based on the specified UPN from Microsoft Graph. Make sure to have the Microsoft Graph PowerShell module installed (Install-Module -Name Microsoft.Graph). The Connect-MgGraph cmdlet is used to establish a connection to Microsoft Graph before executing other Graph-related cmdlets.



    1 person found this answer helpful.
    0 comments No comments