Connect-AzureAD

This Azure PowerShell article will discuss the syntax and usage of the Connect-AzureAD PowerShell command with examples that you can use to connect to Azure AD using PowerShell.

Connect-AzureAD

The Connect-AzureAD is an excellent Azure PowerShell cmdlet that helps you to use Azure AD cmdlet requests by connecting with an authenticated account.

Syntax

Below is the syntax to use the Connect-AzureAD PowerShell command.

Connect-AzureAD
Connect-AzureAD -TenantId <String>

Well, let’s discuss a few examples of how to use the Connect-AzureAD PowerShell command.

Example-1:

You can execute the below PowerShell command to connect the PowerShell session to your tenant to use the PowerShell cmdlet requests.

connect-azuread

After executing the above PowerShell command, You need to enter your credentials. So enter your user ID and then click on the Next button.

connect-azuread powershell

Then, enter the password on the next pop-up and click on the Sign in button.

connect-azuread module

Then, I got the expected output below

Account                   Environment TenantId                             TenantDomai
                                                                           n          
-------                   ----------- --------                             -----------
fewlines4biju@hotmail.com AzureCloud  f8cdef31-a31e-4b4a-93e4-5f571e91255a  

You can see the same output below

Connect-AzureAD

Example-2:

You can also execute the below PowerShell command by specifying your tenant ID.

Connect-AzureAD -TenantId 5d9d690a-0310-474d-ae8b-42df2d549228

After executing the above command, I entered my credentials and got the below-expected output.

connect-azuread with credentials

Connect-AzureAD PowerShell – Video Tutorial

Check out the video below on the Connect-AzureAD PowerShell Command.

Fix the error connect-azuread is not recognized in case you get this error while executing the Connect-AzureAD command.

Once, you are done with all the requests you can use the Disconnect-AzureAD PowerShell command to disconnect from the current session.

Final Thoughts

In this Azure PowerShell article, we discussed the syntax and the usage of the Connect-AzureAD PowerShell command with examples of how to use this command. Thanks for reading this article !!!.