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.
You might also get the following error message stating that PSGallery is untrusted. This is okay so you may safely click the yes button.
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