Powershell : The term ‘Get-AzureADUser’ is not recognized as the name of a cmdlet

Problem :

You might have received the error message “The term Get-AzureADUser is not recognized as the name of a cmdlet” when you run the Azure AD powershell cmdlet Get-AzureADUser to get Office 365 users.

The term 'Get-AzureADUser' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
At line:1 char:16
+ Get-AzureADUser <<<<
    + CategoryInfo          : ObjectNotFound: (Get-AzureADUser:String) [], CommandNotFoundException
    + FullyQualifiedErrorId : CommandNotFoundException

Solution :

The command Get-AzureADUser belongs to Azure Active Directory Powershell for Graph module, so before using this command we need to install and connect AzureAD powershell v2 module.

Install AzureAD module:

Open Powershell console with Run as administrator privilege and run the following command:

Install-Module AzureAD -Force

Connect/Load AzureAD module:

Once you have installed the Azure AD module, run the following command to load the module.

Connect-AzureAD
# Once you connected the AzureAD module, now run the Get-AzureADUser command.
Get-AzureADUser

Advertisement

Leave a Comment