Managing Azure AD User with Azure Active Directory PowerShell for Graph

Azure Active Directory PowerShell for Graph is a PowerShell module used to manage Azure Active Directory. Thanks to this module you can:

  • Retrieve data from the directory,
  • Create new objects,
  • Update existing objects,
  • Remove objects,
  • and configure the directory.

The Azure AD PowerShell for Graph module has two versions:

  • a Public preview version
  • a General Availability version. (https://www.powershellgallery.com/packages/AzureAD)

It’s not recommended to use the Public Preview version for production scenarios but you use it to test the PowerShell module.

Let’s see how to install the Preview Module. Open a PowerShell console as administrator:

If you want to install the Public Module:

You must first connect the Connect-AzureAD cmdlet to connect to your Azure Active Directory:

Use the Get-Command cmdlet to retrieve all the AzureAD cmdlets:

Now I can easily retrieve information about my Azure AD Domain:

I can create a new Azure AD User account using the following command:

Let’s check if the user exists:

Great, the user exists, so I can now update information using the following commands:

That’s all. Azure AD PowerShell is very useful to manage your Azure AD Users.

 

Thanks for reading! You can follow me on Twitter @PrigentNico

About Nicolas 248 Articles
I work as a System Engineer, based in Switzerland with a primary focus on Microsoft technologies. I have 8 years experience in administering Windows Servers. . I am a Microsoft MVP for Cloud & Datacenter Management. I also received the PowerShell Hero 2016 award by PowerShell.0rg. And finally, I am "MCSE: Cloud Platform and Infrastructure", "MCSA: Windows Servers", "Administering & Deploying SCCM", and CheckPoint CCSA certified.