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.
Table of Contents
The Connect-AzureAD is an excellent Azure PowerShell cmdlet that helps you to use Azure AD cmdlet requests by connecting with an authenticated account.
Below is the syntax to use the Connect-AzureAD PowerShell command.
Connect-AzureAD -TenantId <String>
Well, let’s discuss a few examples of how to use the Connect-AzureAD PowerShell command.
You can execute the below PowerShell command to connect the PowerShell session to your tenant to use the PowerShell cmdlet requests.
After executing the above PowerShell command, You need to enter your credentials. So enter your user ID and then click on the Next button.
Then, enter the password on the next pop-up and click on the Sign in button.
Then, I got the expected output below
Account Environment TenantId TenantDomai
------- ----------- -------- -----------
firstname.lastname@example.org AzureCloud f8cdef31-a31e-4b4a-93e4-5f571e91255a
You can see the same output below
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 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.
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 !!!.
I am Rajkishore, and I have over 14 years of experience in Microsoft Azure and AWS, with good experience in Azure Functions, Storage, Virtual Machine, Logic Apps, PowerShell Commands, CLI Commands, Machine Learning, AI, Azure Cognitive Services, DevOps, etc. Not only that, I do have good real-time experience in designing and developing cloud-native data integrations on Azure or AWS, etc. I hope you will learn from these practical Azure tutorials. Read more.