The Office 365 Compliance Center is the management interface for the compliance-related features of Office 365 such as eDiscovery and Mobile Device Management.

To manage the Compliance Center with PowerShell we need to make a remote PowerShell session. If you’ve been managing Office 365 until now you are probably already aware of how to make a remote PowerShell session to Exchange Online.

  • Capture Office 365 admin credentials
  • Create a new PSSession
  • Import the PSSession

As with the Exchange Online remote session the easiest way to establish a remote session to the Compliance Center is by adding a function to your PowerShell profile that you can run each time you need to connect. You can read more about setting up a PowerShell profile here.

You can download the Connect-ComplianceCenter function from Github.

Example usage:

Windows PowerShell
Copyright (C) 2014 Microsoft Corporation. All rights reserved.

PS C:Scripts> Connect-ComplianceCenter

A dialog will pop up and ask you for your Office 365 admin credentials.

WARNING: Your connection has been redirected to the following URI:
"https://emea01b.ps.compliance.protection.outlook.com/powershell-liveid?PSVersion=4.0 "

ModuleType Version    Name                                ExportedCommands
---------- -------    ----                                ----------------
Script     1.0        tmp_ya3sc4o3.v4b                    {Add-eDiscoveryCaseAdmin, Add-RoleGroupMember, Get-AdminAu...

After successfully connecting you’ll be able to run compliance-related cmdlets such as Get-DeviceComplianceSummaryReport.

About the Author

Paul Cunningham

Paul is a former Microsoft MVP for Office Apps and Services. He works as a consultant, writer, and trainer specializing in Office 365 and Exchange Server. Paul no longer writes for Practical365.com.

Comments

  1. Vicknes

    Hi Paul

    When I tried to run the script from Github, I received an error like this. I am running this on Administrator mode. Not sure what went wrong.

    At C:\Users\vicknes.nair\Documents\Function-ConnectComplianceCenter.ps1:148 char:190
    + … ata-ga-click=”(Logged out) Header, go to Features”>Features <span cla …
    + ~
    The '→</s …
    + ~

Leave a Reply