"The term <cmdlet name> is not recognized" error when you try to run Azure Active Directory for Windows PowerShell cmdlets

Article translations Article translations
Article ID: 2669552 - View products that this article applies to.
Expand all | Collapse all

PROBLEM

When you try to run Microsoft Azure Active Directory Module for Windows PowerShell cmdlets, you receive the following error message: 
The term <cmdlet name> 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.

For example, you might see the following similiar message.

The term 'Connect-MsolService' 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:20
+ Connect-MsolService <<<<
+ CategoryInfo : ObjectNotFound: (Connect-MsolService:String) [], CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException

CAUSE

This issue can occur if the Azure Active Directory Module for Windows PowerShell isn't loaded correctly.

SOLUTION

To resolve this issue, follow these steps.
  1. Install the Azure Active Directory Module for Windows PowerShell on the computer (if it isn't already installed). To install the Azure Active Directory Module for Windows PowerShell, go to the following Microsoft website:
  2. Click Start, point to All Programs, click Windows Azure Active Directory, and then click Windows Azure Active Directory Module for Windows PowerShell.
  3. At the Windows PowerShell command prompt, type get-Module, and then press Enter.
  4. In the output, check that the MSOnline module is present. The output should look similiar to the following:
    Module Type Name Exported Commands
    -------------- -------- ----------------
    Binary MSOnline {Add-MsolRoleMember, Remove-MsolContact...
Note If the MSOnline module isn't present, use Windows PowerShell to import the MSOnline module. To do this, follow these steps:
  1. Connect to Exchange Online by using remote PowerShell. For more info about how to do this, go to the following Microsoft website:
    Connect to Exchange Online Using Remote PowerShell
  2. Type the following cmdlet, and then press Enter:
    Import-Module MSOnline

MORE INFORMATION

Still need help? Go to the Office 365 Community website or the Azure Active Directory Forums website.

Properties

Article ID: 2669552 - Last Review: July 9, 2014 - Revision: 14.0
Applies to
  • Microsoft Azure
  • Microsoft Office 365
  • Windows Intune
  • CRM Online via Office 365 E Plans
  • Microsoft Azure Recovery Services
  • Office 365 Identity Management
Keywords: 
o365 o365e o365p o365m o365a o365022013 KB2669552

Give Feedback

 

Contact us for more help

Contact us for more help
Connect with Answer Desk for expert help.
Get more support from smallbusiness.support.microsoft.com