We were recently transitioned to Office365 and learned that certain settings and permissions did come across during the upgrade. This meant that some settings and permissions needed to be reconfigured via PowerShell. Back in the days of BPOS, you needed the Migration ToolKit installed in order to use any of the Microsoft Online related PowerShell Cmd-Lets. With Office365, you don’t need this! Instead, you need to open a server side connection to the cloud servers from your local machine. Below are the steps to do this.
- Load your Office365 credentials in a variable
$Cred = Get-Credential
- Create a session variable which will configure a connection to the cloud servers
$Sess = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri https://ps.outlook.com/powershell/ -Credential $Cred -Authentication Basic -AllowRedirection
- Initialize the session
Import-PSSession $Sess
- Run any of the Exchange Online Cmdlets found in the documentation.
- Once you’re done running commands, you can close the session
Remove-PSSession $Sess
Note: The guts of this post came from a Microsoft Article which I never was able to come across in my searching, but rather was pointed to via a service request.