How to install the Azure Active Directory PowerShell Module

How to install the Azure Active Directory PowerShell Module

In order to connect to manage users and organisation settings in Office 365 via Powershell, you need to install the Azure Active Directory PowerShell Module. This can be simply installed via PowerShell itself.

Why do you need the Azure Active Directory PowerShell Module?

This module allows you to perform a lot of the Office 365 user and organisation administration tasks via PowerShell. It’s great for bulk tasks like password resets, password policies, license management/reporting etc.

If you’re a Microsoft Partner, and are managing your customers Office 365 tenants via delegated administration, this module gives you a secure way to perform admin tasks using your own credentials. See our guide here for more info.

Importantly, this module doesn’t give you the ability to manage the features of Exchange Online, Skype for Business, SharePoint/OneDrive etc. These require a separate PowerShell connection method or PowerShell module.

How to Install the Azure Active Directory PowerShell Module via PowerShell

  1. Open the Start menu on your computer and search for ‘Powershell’
  2. Right-click on Windows PowerShell and choose ‘Run as administrator’Run PowerShell As Administrator
  3. Type the following command and press enter.
    Install-Module -Name MSOnline
  4. Type “Y” to install and import the NuGet providerInstall Azure Active Directory PowerShell Module with Install-Module MSOnline Cmdlet
  5. Type “Y” again to trust the providerAccept Terms and InstallAzure Active Directory PowerShell Module
  6. Wait for the package to install, then type the following to enter your Office 365 admin credentials and connect to Azure Active Directory via PowerShell:
    Run Connect-MsolService To Connect to Azure Active Directory Powershell Module
  7. Once the Azure Active Directory PowerShell module has been installed, you only need to run the Connect-MsolService command to connect to the Azure AD service on this PC.


To perform Exchange Online Administration tasks, you’ll need to set up a separate connection to Exchange Online via PowerShell. Follow our quick guide here for more info.


Was this article helpful?

Related Articles

4 replies
  1. Pinterest
    Pinterest says:

    Hello, I think your blog could possibly be having browser compatibility issues.
    Whenever I look at your web site in Safari,
    it looks fine however, when opening in I.E., it’s got some overlapping issues.

    I merely wanted to provide you with a quick heads up!
    Besides that, great website!

    Have a look at my site; Pinterest

  2. situs gacor PG hari ini
    situs gacor PG hari ini says:

    Hiya! I know this is kinda off topic nevertheless I’d figured I’d ask.
    Would you be interested in trading links or maybe guest authoring a blog post or vice-versa?
    My blog goes over a lot of the same subjects as yours and
    I think we could greatly benefit from each other. If you are interested feel free to shoot me
    an email. I look forward to hearing from you! Wonderful blog by the way!

    Visit my website … situs gacor PG hari ini

Leave a Reply

Want to join the discussion?
Feel free to contribute!

Leave a Reply

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