How to Connect to Office 365 using Powershell

You can use Powershell to connect to your Office 365 services. If you are new to Powershell, this can be complex and confusing to manage your Office 365 from a Powershell window, but once you understand how Powershell commands (cmdlets) work, it's powerful and a valuable tool.

Firstly, 

Please make sure you have installed Microsoft Online Services Sign-In Assistant for IT Professionals RTW, which can be downloaded here.

  1. Open Powershell as an Administrator on your machine
  2. Run the below cmdlets
  3. Install-Module -Name AzureAD
  4. $UserCredential = Get-Credential
  5. A Windows Powershell credential request pop up will appear
  6. Use your o365-admin credentials
  7. $Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri https://outlook.office365.com/powershell-liveid/ -Credential $UserCredential -Authentication Basic -AllowRedirection
  8. Import-PSSession $Session -DisableNameChecking


Please contact us here if you need any Technical Support.

Leave a comment