Azure AD PowerShell module installation got easier

Azure AD PowerShell module installation got easier

Azure AD PowerShell module was earlier installed by a standard .msi package. Now you can install it using one PowerShell command. However, installation requires PowerShell 5 or newer.

Before you begin

Module installation requires PowerShell 5 or later which is included in Windows 10 & Server 2016. If you have previous version of Windows, you need to install Windows Management Framework 5.1 here.

Installing the Azure AD PowerShell module

To install the latest Azure AD PowerShell module, enter the following commands as an administrator.

Azure AD PowerShell v1 (MsOnline)

# Install the MsOnline module

Install-Module MSOnline

If you haven’t used the Install-Module command earlier, you might not have NuGet provider. Just click the Yes to continue.

alt text

You might also get the following error message stating that PSGallery is untrusted. This is okay so you may safely click the yes button.

alt text

Now you are ready to connect to Office 365!

Connect-MsolService

Azure AD PowerShell v2 (AzureAD)

# Install the AzureAD module

Install-Module AzureAD

Now you are ready to connect to Office 365!

Connect-AzureAD

Azure AD PowerShell v2 preview (AzureADPreview)

Note! AzureAD Preview has same commands than AzureAD, only the module name is different. Therefore, they cannot be installed in the same computer together.

# Install the AzureAD module

Install-Module AzureADPreview

Now you are ready to connect to Office 365!

Connect-AzureAD
Dr Nestori Syynimaa avatar
About Dr Nestori Syynimaa
Dr Syynimaa works as Senior Principal Information Security Researcher at Secureworks CTU (Counter Threat Unit).
Before moving to his current position, Dr Syynimaa worked as a CIO, consultant, trainer, and university lecturer for over 20 years. He is a regular speaker in scientific and professional conferences related to Microsoft 365 and Azure AD security.

Dr Syynimaa is Microsoft Certified Expert (Microsoft 365), Microsoft Certified Azure Solutions Architect Expert, Microsoft Certified Trainer, and Microsoft MVP (Enterprise Mobility, Identity and Access & Intune).
comments powered by Disqus