Office 365 - Powershell

April 11, 2016 0 Comments office-365, powershell

Connecting to Office 365 via Powershell for the first time? Here are the steps to get started:

  1. Install the Microsoft Online Services Sign-In Assistant for IT Professionals RTW
  2. Install the Azure Active Directory Module for Windows Powershell (64-bit version)
  3. Open Powershell and run this command the first time you connect on your computer:
Set-ExecutionPolicy RemoteSigned
  1. Next, run these three commands (you'll do this everytime you want to connect):
$UserCredential = Get-Credential

$Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri https://outlook.office365.com/powershell-liveid/ -Credential $UserCredential -Authentication Basic -AllowRedirection

Import-PSSession $Session
  1. You should now be connected.  When finished, run:
Remove-PSSession $Session

Update: Here is an awesome project on github that is a Office 365 Powershell GUI: https://github.com/bwya77/O365-Administration-Center

Microsoft References:

https://technet.microsoft.com/en-ca/library/jj151815.aspx#bkmk_installmodule
https://technet.microsoft.com/en-us/library/jj984289(v=exchg.160).aspx