Connect to Azure AD with PowerShell

On your Windows device open a PowerShell prompt. To be able to connect we first need to make sure that the PowerShell module has been installed. Run the following command and confirm all questions with yes

Install-Module -Name AzureAD

Now we are ready to connect to Azure AD. Because of the different Office 365 clouds, it might be required to add the option -AzureEnvironmentName. Please review your environment below, by default you are hosted in Worldwide.

Office 365 cloud Command
Office 365 Worldwide (+GCC) Connect-AzureAD
Office 365 operated by 21 Vianet Connect-AzureAD
-AzureEnvironmentName AzureChinaCloud
Office 365 Germany Connect-AzureAD
-AzureEnvironmentName AzureGermanyCloud
Office 365 U.S. Government Connect-AzureAD
-AzureEnvironmentName AzureUSGovernment

Run the command:

Connect-AzureAD

You will now be prompted with a sign-in prompt. After sign-in you are connected

Log in screen

6 Replies to “Connect to Azure AD with PowerShell”

  1. I really like what you guys are up too. This sort of clever work and coverage!

    Keep up the superb works guys I’ve added you guys
    to my own blogroll. I’ll immediately snatch your rss feed
    as I can’t find your e-mail subscription link or newsletter service.
    Do you have any? Please allow me recognize in order that I may just subscribe.
    Thanks. I truly love your website.. Pleasant colors & theme.
    Did you build this site yourself? Please reply back as I’m hoping to create my own personal blog and would like to know where you got this from or
    what the theme is named. Thanks!

  2. Hello there, I found your web site by way of Google even as looking for a similar matter, your site got here up, it seems great. I’ve bookmarked it in my google bookmarks. You are a very capable individual!

  3. What’s up, the whole thing is going perfectly here and ofcourse every one is sharing facts, that’s actually good, keep
    up writing.

Leave a Reply

Your email address will not be published. Required fields are marked *