In this post, I’m going to show you how to connect to Azure AD using PowerShell.
I’ll also show you how to list all of the available commands from the AzureAD module.
Let’s get started.
Note: Your computer will need at least PowerShell version 5.1 to use the Azure AD module. Refer to the article update PowerShell version for instructions on upgrading PowerShell.
Step 1: Install Azure AD Module
Before you can connect to Azure AD with Powershell you first need to install the AzureAD module.
Open PowerShell on your local computer and enter the below command:
install-module AzureAD
You may get a popup that says “PowerShellGet requires NuGET provider version “” or newer”
Click yes to continue.
![install azuread powershell module](https://activedirectorypro.com/wp-content/uploads/2022/11/connect-azure-ad-powershell-1.webp)
You may also get a pop up that says “You are installing modules from an untrusted repository.”
Click Yes to continue.
![untrusted repository powershell warning](https://activedirectorypro.com/wp-content/uploads/2022/11/connect-azure-ad-powershell-2.webp)
The AzureAD module should now be installed.
You can verify that it is installed by running the below command:
Get-Module AzureAD -ListAvailable
If the module is installed you should see it listed like the screenshot below.
![powershell command verify azuread module is installed](https://activedirectorypro.com/wp-content/uploads/2022/11/connect-azure-ad-powershell-3.webp)
If you already have the AzureAD module installed you can update it with the below command:
Update-Module -Name AzureAD
Now that the module is installed and updated you can move to step 2.
Step 2: Connect to Azure AD Using PowerShell
To connect to Azure AD type the below command:
Connect-AzureAD
You will be prompted to sign in with your Azure AD credentials (MFA is supported).
![connect to azuread with powershell](https://activedirectorypro.com/wp-content/uploads/2022/11/connect-azure-ad-powershell-4.webp)
When successfully authenticated it will display your account and TenantID.
![](https://activedirectorypro.com/wp-content/uploads/2022/11/connect-azure-ad-powershell-5.webp)
You should now be connected to Azure AD via PowerShell.
Pretty easy right?
To get a list of all the AzureAD cmdlets, use the command:
get-command -Module AzureAD
![list all azure powershell cmdlets](https://activedirectorypro.com/wp-content/uploads/2022/11/connect-azure-ad-powershell-6.webp)
We hope you found this tutorial helpful. And if so, you may be interested in these resources: