How to Install and Connect Azure AD PowerShell

Azure Active Directory PowerShell is a module that provides cmdlets to manage Office 365 Users and all other Azure AD objects with Windows PowerShell. You can use the cmdlets to create, delete, and manage objects and services delivered through the Azure platform.

Step 1: Install Azure AD PowerShell Module

First, you have to install Microsoft Online Services Sign-In Assistant, the Sign-In Assistant provides end user sign-in capabilities to Microsoft Online Services.

#1 Install Microsoft Online Services Sign-In Assistant for IT Professionals RTW

#2 Then install the Azure Active Directory Module for Windows PowerShell.

    – For 64-bit machine
    – For 32-bit machine

Step 2: Connect to Azure AD

Once you have installed all the required components, you must first import Azure AD powershell module by running the following command.

Import-Module MSOnline

Then connect to your online service. Run the below script to connect Azure AD online service.

$msolCred = Get-Credential
Connect-MsolService –Credential $msolCred

Now, you can manange your connected online Azure AD service through Azure AD PowerShell cmdlets, such as Get-MsolUser, Set-MsolUserPassword, etc..

Example:

The following command retrieves the office 365 user with the UPN [email protected]

Get-MsolUser -UserPrincipalName [email protected]
Advertisement

Leave a Comment