Saturday, July 4, 2015

Manage Exchange on Office 365 by PowerShell

Some of Office 365 services can be managed by Windows PowerShell like SharePoint, Skype for Business, Exchange and so on. To manage these services, the basic requirements are the following:

Operating Systems (64-bit):
Windows 8.1 or Windows 8
Windows Server 2012 R2 or Windows Server 2012
Windows 7 Service Pack 1
Windows Server 2008 R2 SP1

Required components:
Microsoft .Net Framework 4.5.x and Windows Management Framework 3.0 or later.

To manage Exchange on Office 365, we don't need to install additional tool. We can directly import Exchange cmdlets from Office 365.

Lab environment
Windows Server 2012 R2 is installed the required components

1. Launch Windows PowerShell as administrator.
2. Perform Set-ExecutionPolicy RemoteSigned -Verbose -Force to update the execution policy of Windows PowerShell.


3. Perform $cred = Get-Credential


4. Enter the Exchange administrator user name and password into the dialog box and then click OK.


5. Perform $ExchangeSession = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri "https://outlook.office365.com/PowerShell-liveid/" -Credential $cred -Authentication Basic -AllowRedirection to create a new PowerShell remote session to your Office 365 account.


Remark: Microsoft doesn't support an administrator account on Office 365 or other online services which is enabled Multi-Factor Authentication for Windows PowerShell Management.

6. Perform Import-PSSession $ExchangeSession -DisableNameChecking to import the PowerShell cmdlets from Exchange on Office 365.



All cmdlets is under the temporary PowerShell module name.

As a result, we can perform PowerShell cmdlets to manage Exchange on Office 365.


More information


This posting is provided “AS IS” with no warranties, and confers no rights!

No comments:

Post a Comment