Use PowerShell To Connect To AzureAD
If you already have one of the following required releases installed:
- Windows 10 or newer
- Windows Server 2016 or newer
- Windows Management Framework (WMF) 5.0 or newer
- PowerShell 6
Then, you won't need the PowerShellGet module (available here) as it is included into the above releases. If one of these releases are not installed, follow the steps using the above link to install the module.
Afterwards, we will install Azure Active Directory V2 PowerShell Module (hosted on the PowerShell gallery) because Office 365 uses this cloud-based user-authentication service to store users.
To do that, open Powershell as an administrator and run the following cmdlet:
Install-Module -Name AzureAD
You should get the following warning as described below:
$cred = Get-Credential
You will be prompted to type your credentials and they will be saved into the variable "$cred" as shown below:
Run the Connect-AzureAD PowerShell cmdlet and give the -Credential parameter with the variable $cred create previously.
Please note that entering a tenant name is not mandatory as Azure AD will automatically connect your tenant on the email address.
If you use MFA (Multi Factor Authentication) to connect to Azure Active Directory, run Connect-AzureAD without the -Credential parameter.
You are now connected to Azure Ad and you can now run PowerShell cmdlets.
For example, Get-AzureADUser (return all the user including external ones), Get-AzureADUser | where {$_.department -eq "Finance"} (display the properties of a user), etc...
Hope this tutorial will help solve issues related to Microsoft Azure Active Directory.
Leaving a review only takes 30 seconds and i appreciate it so much!
Great information. Thanks for sharing.
ReplyDeleteProject Online
Thank you for your comment.
DeleteNice Article,
ReplyDeleteIs your PST file corrupt? Looking for a solution to fix and recover damaged and corrupt files? If you are getting these issues then we suggest you download the Microsoft Scanpst Software.
Thanks again...
Thank you for your comment.
DeleteThank you for your the valuable information.
ReplyDelete