In this Azure AD tutorial, we will discuss how to fix the error, the term ‘connect-azuread’ is not recognized as the name of a cmdlet function Azure which comes while trying to connect to Microsoft Azure AD.
Table of Contents
The term ‘connect-azuread’ is not recognized as the name of a cmdlet function Azure
Recently, I was trying to connect to Azure AD using Connect-AzureAD command from Windows PowerShell, I got the error as the term ‘connect-azuread’ is not recognized as the name of a cmdlet function script file or operable program.

The term ‘connect-azuread’ is not recognized as the name of a cmdlet function [Solution]
- To fix the error, open Windows PowerShell command prompt in administrator mode

2. The next step is, run the below PowerShell cmdlet to Install the Azure AD Module
Install-Module AzureAD
3. Confirm the installation by clicking on the Yes to All button in the below window.

Now it will install the AzureAD module successfully without any issue. Now the error “the term ‘connect-azuread’ is not recognized as the name of a cmdlet function script” will not come. This will also fix the error ‘connect-azuread’ is not recognized as the name of a cmdlet
- How to Connect to Azure in PowerShell (And Azure AD)
- How to create a user in Azure active directory
- What is Azure Active Directory B2B collaboration (Azure AD B2B)
The term ‘Connect-MsolService’ is not recognized as the name of a cmdlet function script
Similarly, if you are getting error as 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, then run the below command in Windows PowerShell.
Solution-1:
- To fix the error, open Windows PowerShell command prompt in administrator mode

2. The next step is run the below PowerShell cmdlet to install the MSOnline module
Install-Module -Name MSOnline
After successfully executed, you will not get the error, The term ‘Connect-MsolService’ is not recognized as the name of a cmdlet function script.
Solution-2:
If the above solution did’nt work for you and you are still getting the same error then try the below steps
Run the below PowerShell cmdlets in the same order one after other
uninstall-module AzureAD
install-module AzureAD
install-module AzureADPreview
install-module MSOnline
This will fix the error The term ‘Connect-MsolService’ is not recognized as the name of a cmdlet. If you are still getting the same issue then try the below solution.
Solution-3:
- You will have to Uninstall the ‘Microsoft Online Service Sign-in Assistant’ and ‘Windows Azure Active Directory” Module.
- The next step is to install 64-bit versions of ‘Microsoft Online Service Sign-in Assistant’ and ‘Windows Azure Active Directory Module for Windows PowerShell.
- There might be a chance you will get the error like In order to install Windows Azure Active Directory Module for Windows PowerShell, you must have Microsoft Online Services Sign-In Assistant version 7.0 or greater installed on this computer. So you need to install the Microsoft Online Services Sign-In Assistant for IT Professionals BETA.
- The next step is to Copy the folders called MSOnline and MSOnline Extended from the source (C:\Windows\System32\WindowsPowerShell\v1.0\Modules\) to the Folder (C:\Windows\SysWOW64\WindowsPowerShell\v1.0\Modules\).
You may like following Azure tutorials:
- What is Microsoft Azure and How does Microsoft Azure Works?
- Azure active directory premium features
- How to Create Azure Free Account (Step by Step tutorial)
- The term ‘get-aduser’ is not recognized as the name of a cmdlet in Windows 10 PowerShell
Wrapping Up
In this Azure tutorial, we discussed how to fix the error, the term ‘connect-azuread’ is not recognized as the name of a cmdlet function and the same solution will also fix the below errors
- The term ‘connect-azuread’ is not recognized as the name of a cmdlet
- connect-azuread: the term ‘connect-azuread’ is not recognized as the name of a cmdlet, function, script file, or operable program.
- connect-azuread is not recognized
- connect-azuread: the term ‘connect-azuread’ is not recognized as the name of a cmdlet
- The term connect-azuread is not recognized
- The term ‘connect-azuread’ is not recognized
- connect-azuread : the term ‘connect-azuread’ is not recognized as the name of a cmdlet
- The term ‘connect-azuread’ is not recognized as the name of a cmdlet, function, script file, or operable program.
- connect-azure ad is not recognized as the name of a cmdlet
- connect-azuread not found
We have also discussed how to fix the error The term ‘Connect-MsolService’ is not recognized as the name of a cmdlet function script.