Azure Active Directory Module for Windows Powershell

Azure Active Directory Module for Windows Powershell

In this Azure tutorial, we will discuss the Azure Active Directory Module for Windows Powershell. Along with this, we will also discuss the below topics.

  • Why do you need the Azure Active Directory PowerShell Module?
  • Microsoft Azure Active Directory Module for Windows
  • Update Azure AD PowerShell Module
  • Azure Active Directory PowerShell for Graph
  • Installation of the Azure AD Module and AzureADPreview module
  • How to update the Azure AD module?
  • Connect to Azure AD PowerShell
  • What is msonline module?
  • What is the difference between Azure AD Module and MS Online module?

Why do you need the Azure Active Directory PowerShell Module?

Before installing the Azure Active Directory PowerShell module for windows, we should know why do you need the Azure Active Directory PowerShell module? then we will discuss the Azure Active Directory Module for Windows Powershell.

Once you installed the Azure Active Directory PowerShell module, you can able to manage many administrative tasks related to the Office 365 user and your Organisation using PowerShell. Also, it helps you to provide you the capability to reset the passwords, policies related to the Password, and the license management.

Azure Active Directory Module for Windows Powershell

Now, we came to know why do you need the Azure Active Directory PowerShell module? So let’s discuss how to install the Azure Active Directory Module for Windows Powershell. Follow the below steps to install the Azure Active Directory Module.

Step-1: Open the Windows PowerShell or PowerShell ISE as an Administrator mode.

Azure Active Directory Module for Windows Powershell

Step-2: Now you can run the below PowerShell cmdlet to install the MSOnline module.

Install-Module -Name MSOnline
Why do you need the Azure Active Directory PowerShell Module

Step-3: Click on the Yes button from the above Pop up. Once you click on the Yes button, it will install the module successfully.

microsoft azure active directory module for windows

You can see above, the PowerShell module has been installed successfully with out any issue.

Step- 4: Now use the below PowerShell cmdlet to connect to the Active Directory.

PS C:\WINDOWS\system32> Connect-MsolService

Step-5: Once you will enter the above PowerShell cmdlet, It will prompt you to enter your credentials. Enter your Office or school account details.

how to install the Azure Active Directory Module for Windows Powershell

Here we have discussed windows azure active directory module for windows powershell download option.

Microsoft Azure Active Directory Module for Windows

Azure AD Connect is one of the Microsoft tools that helps with multiple features for example Password hash synchronization – This is a sign-in method that synchronizes a hash of the on-premises Active Directory password of the user with Azure AD.

It also allows you to quickly onboard to Azure AD and Office 365.

For more information on the Azure AD Connect like download, installation, Azure ad connect requirements details you can check my article Azure AD connect download.

Update Azure AD PowerShell Module

In Common, if you want to update a PowerShell module, you can do the same way how you are installing the module. The only thing is for installing, you are using InstallModule command. Same way if you want to update the module you can use the UpdateModule command.

For Example, if you want to update all of your installed module, then you can use the below cmdlets

PS C:\WINDOWS\system32> Update-Module

If you want to update a specific module, then you can mention the name of your module with the below cmdlet

PS C:\WINDOWS\system32> Update-Module -Name ModuleName

For example, if we want to update the Azure Active Directory module that we installed by following the above steps, then you can use the below cmdlet

PS C:\WINDOWS\system32> Update-Module -Name MSOnline
Update Azure AD PowerShell Module

You can also update a module to a specified version using the below cmdlet

PS C:\WINDOWS\system32> Update-Module -Name MSOnline -RequiredVersion version number

Finally, if you want to update the module without the confirmation, you can use the below PowerShell cmdlet

Update-Module -Name MSOnline  -Force

This is how we can update Azure AD PowerShell Module.

Azure Active Directory PowerShell for Graph

Azure Active Directory PowerShell for Graph (AzureAD) is a module that is used to manage the Azure Active Directory.

you can perform many operations like retrieve data from the Azure Active Directory, create and update the objects in Azure Active Directory. With the help of AzureAD cmdlet, you can also configure the ActiveDirectory and all its features.

The AzureAD module is also used to do all the user management task, to configure the single sign-on option in Azure Active Directory.

There are two versions of Azure AD PowerShell for Graph module i.e a Public preview version (AzureADPreview) and a General Availability version (AzureAD).


Installation of the Azure AD Module and AzureADPreview module

There are some operating systems that are supported for the installation of AzureAD module. These are as below

  • Windows 8
  • Windows 7
  • Windows Server 2012 R2
  • Windows Server 2012
  • Windows Server 2008 R2

You can use the below PowerShell cmdlet to install the AzureAD module

PS C:\WINDOWS\system32> Install-Module AzureAD
Installation of the Azure AD Module

Once you will execute the above PowerShell cmdlet, you will see it will start the installation and will complete the installation successfully.

Installation of the Azure AD Module Powershell

To install the AzureADPreview module, use the below PowerShell cmdlet

PS C:\WINDOWS\system32> Install-module AzureADPreview
Installation of AzureADPreview module

Once you will run the above PowerShell cmdlet, Click on the Yes button from the below pop up.

How to Install AzureADPreview module PowerShell

Once you will click on the Yes button, it will start installing the AzureADPreview module. It will take few seconds to install the AzureADPreview module.

How to Install AzureADPreview module

The Azure AD module is available in the PowerShell gallery. You can check the updated version using the PowerShell Get module.

How to update the Azure AD module?

You can check the latest version of the Azure AD module available in the PowerShell Gallery using the below PowerShell cmdlet.

PS C:\WINDOWS\system32> Get-Module AzureADPreview

Now you can see the latest version available in the PowerShell Gallery.

Now, if you want to update the Azure AD module to the latest version then you need to run the below PowerShell cmdlet again.

PS C:\WINDOWS\system32> Install-Module AzureADPreview
How to update the Azure AD module?

This will check if the latest version is available in the PowerShell Gallery, it will install the latest version of the Azure AD module on your computer. If already the latest version is available in your system then it will not do anything.

Connect to Azure AD PowerShell

Before running any of the PowerShell cmdlets related to Azure AD as discussed above, you should connect to your online service using Connect-AzureAD cmdlet.

Once you will execute the below cmdlet, it will prompt you to enter your credentials to connect to your Azure AD module.

PS C:\WINDOWS\system32> Connect-AzureAD
How to connect to Azure AD

Now we have discussed about Azure AD. Now let’s see what is msonline module?

What is msonline module

Let’s discuss what is msonline exactly?. This is the older version of Azure Active Directory PowerShell module. This is the version one of the Azure Active Directory module.

There are some features that are available in the MSOnline module, that are not present still in version 2.0 i.e AzureAD module.

Msonline provides some of the functionality that is not yet available in the latest version AzureAD module.

We have already discussed above how to install the Msonline module.

Below are few PowerShell cmdlets of Azure Active Directory MSOnline module that helps us to perform multiple tasks

Add-MsolAdministrativeUnitMemberThis helps us to add a member to an administrative unit.
Add-MsolGroupMemberThis helps to add a member to an existing security group.
Connect-MsolServiceThis command helps to initiate a connection to Azure Active Directory.
Disable-MsolDeviceThis helps us to disable a device object in Azure Active Directory.
Enable-MsolDeviceThis command helps to Enable a device object in Azure Active Directory
Get-MsolSubscriptionThis command helps to get subscriptions
Get-MsolUserThis command helps to gets users from Azure Active Directory
Get-MsolContactThis command gets you the contacts from Azure Active Directory.
Get-MsolDeviceThis cmdlet helps to gets an individual device or a list of devices.
Get-MsolGroupThis cmdlet helps to retrieve a group from Microsoft Azure Active Directory.
Get-MsolGroupMemberThis cmdlet helps to retrieve all members of the specified group.
New-MsolGroupThis cmdlet helps to add a new group to the Azure Active Directory
New-MsolUserThis cmdlet creates a user in Azure Active Directory
Remove-MsolContactIt helps to remove a contact from Azure Active Directory.
Remove-MsolDeviceIt helps to remove a device object from Azure Active Directory.
Set-MsolDomainIt helps to Modify settings of a domain.
Set-MsolGroupIt helps to update a security group.
Set-MsolUserIt helps to Modify a user in Azure Active Directory.

For more information on more PowerShell cmdlet on Msonline , you can visit to Microsoft Official site.

What is the difference between Azure AD Module and MS Online module?

AzureADMSOnline
Azure AD module is the new module for Azure Active Directory. It is Azure Active Directory PowerShell for GraphMS Online is the old module for Azure Active Directory.
This module is known as the Azure Active Directory module version 1.0.This module is known as the Azure Active Directory module version 2.0.
Microsoft recommends to use the newer AzureAD module.There are some features that are available in MSOnline that are not present still in the AzureAD module.
To install the AzureAD module, you can use the below PowerShell cmdlet

PS C:\WINDOWS\system32> Install-Module AzureAD
To install the MSOnline module, you can use the below PowerShell cmdlet

PS C:\WINDOWS\system32> Install-Module -Name MSOnline

These are the difference between Azure AD Module and MS Online module.

You may like to follow the below articles

Conclusion

Well, in this tutorial, we discussed Azure Active Directory Module for Windows Powershell, Why do you need the Azure Active Directory PowerShell Module?, Microsoft Azure Active Directory Module for Windows, Update Azure AD PowerShell Module and also we discussed Azure Active Directory PowerShell for Graph, Installation of the Azure AD Module and AzureADPreview module, How to update the Azure AD module?, Connect to Azure AD PowerShell and finally we discussed What is ms online module? and What is the difference between Azure AD Module and MS Online module?.