This KB will cover how to connect to Office 365 (Azure AD) using Powershell.
- Launch Powershell as a Administrator and the following Modules
Install-Module -Name MSOnline
Install-Module -Name AzureAD
If you receive a message about installing from an untrusted repository, ensure that it refers to the PSGallery repository, then enter Y
Connect Powershell to Microsoft 365
- Create a Credential Object
$Creds = Get-Credential
You will be promoted to enter your Microsoft 365 admin credentials and click on OK
- To connect to the Azure Active Directory Module for Windows PowerShell or MSOnline module, use the Connect-MsolService cmdlet and supply the $creds variable.
Connect-MsolService -Credential $creds
Verify Your Connection
If PowerShell makes a successful connection using the MSOnline module, the windows will not prompt any information. To verify the connection, please run the following command.
Still Need Help? Open a Ticket
Let one of our experienced engineer resolve the issue