How to Connect to Office 365 Security & Compliance Center Using PowerShell

In this article, I will show you how to connect to Microsoft Security & Compliance centre using PowerShell and use cmdlets to manage it.

About Security & Compliance

Office 365 Security and Compliance Center combine all the tools and services that allow organisations to protect or comply with legal regulatory standards in one place.

Some of the tools in S&C are DLP, Audit and Azure Identity Protection, Data Governance Policy and many more tools.

Get Started

To get started you will need an Office 365 account with a Global Administrator permissions and machine with PowerShell console.

The first step is to run the cmdlet below and enter the Office 365 username and password.

$UserCredential = Get-Credential

Next, I will use the cmdlet below to connect to the Service and load all the available cmdlet in the Security and Compliance Center.

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

To view all the available cmdlets, run the cmdlet below with the name of the module under the name.

Get-Command -Module tmp_0yvpmopb.h2x

To disconnect from the remote PowerShell session run the cmdlet below.

Remove-PSSession $Session

Posted

in

by