How to set up a quick connection to the Office 365 Security & Compliance Center via Powershell
It’s a good idea to create shortcuts to the various Office 365 services, so you can quickly log on to them without having to copy and paste commands one by one.
Easily connect to the Office 365 Security & Compliance Center via Powershell
Open PowerShell as an administrator
- Go to Start, search for PowerShell, right click Windows Powershell and Run as Administrator
Create a PowerShell profile with a new function
- If you haven’t already configured a PowerShell Profile, run this:
New-item –type file –force $profile
- Then this:
notepad $profile
- Now copy the following PowerShell function into the notepad document and save it:(Be sure to replace [email protected] with your username).
Function Connect-SecurityCompliance{ $credentials = Get-Credential -Credential [email protected] Write-Output "Getting the Security & Compliance Center cmdlets" $Session = New-PSSession -ConnectionUri https://ps.compliance.protection.outlook.com/powershell-liveid/ ` -ConfigurationName Microsoft.Exchange -Credential $credentials ` -Authentication Basic -AllowRedirection Import-PSSession $Session }
Use the new function to connect quickly to the Office 365 Security & Compliance Center
- Close PowerShell and run it again.
- From now on you can just type Connect-SecurityCompliance, or just type connect and press TAB until it appears.
- Enter your password and you’re good to go. Now your computer is set up to connect to the Office 365 Security and Compliance Center without having to copy and paste multiple commands.
Leave a Reply
Want to join the discussion?Feel free to contribute!