Connect Azure AD (Active Directory) for PowerShell


In order to make use of the PowerShell commands to manage your Azure AD environment you can install the Azure AD module for PowerShell as follows.


Prerequisites:

Microsoft Azure AD module supported Windows Operating Systems:

  • Windows 7/8/8.1/10/11
  • Windows Server 2008/2012/2012 R2


Steps to install Azure AD for PowerShell

  • Step 1: Open PowerShell, make sure you open it as an administrator.
  • Step 2: To install Azure AD for the PowerShell module run the below command.
    Install-Module AzureAD
  • Step 3: After the module is installed, you would need to connect Azure AD by running the below command,
    Connect-AzureAD
    You will be prompted to enter your Azure AD Administrator Credentials.
  • Step 4: Once connected, you should see the Azure AD tenant name displayed in the PowerShell prompt.

Test if the connection was successful by running a command like Get-AzureADUser


Azure AD PowerShell module is not compatible with PowerShell 7. For now, it only supports PowerShell 5.1.

Facing issues? Have Questions? Post them here! I am happy to answer!

Author Info:

Rakesh (He/Him) has over 14+ years of experience in Web and Application development. He is the author of insightful How-To articles for Code2care.

Follow him on: X

You can also reach out to him via e-mail: rakesh@code2care.org



















Copyright © Code2care 2024 | Privacy Policy | About Us | Contact Us | Sitemap