JJ365
Published in

JJ365

Office 365 Security and Compliance Center Powershell

Office 365 Security and Compliance Center Powershell
Photo by Philipp Katzenberger on Unsplash

Set Execution Policy

Set-ExecutionPolicy RemoteSigned

Connect to Office 365 Security and Compliance Center

  • Your organization uses federation authentication
  • The global administrator you’re using is synchronized with active directory
  • A location condition in an Azure Active Directory conditional access policy restricts your access to trusted IPs
$UserCredential = Get-Credential
$Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri https://ps.compliance.protection.outlook.com/powershell-liveid/ -Credential $UserCredential -Authentication Basic -AllowRedirection
Import-PSSession $Session -DisableNameChecking
Remove-PSSession $Session

Connect to Security and Compliance Center Powershell using MFA

Exchange Admin Center > Hybrid Set up > Configure
Exchange Admin Center > Hybrid Set up > Configure
  • If you notice, you download the same module when connecting to Exchange Online and Security and Compliance Powershell using MFA. However, you cannot use the same window for two different sessions. You need to use separate sessions of the Exchange Online Remote Powershell Module.
  • Delegated Access Permission (DAP) partners cannot use these procedures for their customer’s tenant. MFA and Exchange Online Remote Powershell Module won’t work with delegated authentication.
  • Exchange Online Remote Powershell Module is not supported in Powershell core (macOS, Linux, or Windows Nano Server). As a workaround, you can install a module a computer that’s running a supported version of windows and use remote desktop software to connect.
Connect-IPPSSession -UserPrincipalName jj@jj365.com
  • Enter your Office365 global administrator credentials and verify the code that is sent to your phone for authentication
Different URI values to connect to Office365 Security and Compliance Center
Different URI values to connect to Office365 Security and Compliance Center
Connect-IPPSSession -UserPrincipalName lukas@fabrikam.com -ConnectionUri https://ps.compliance.protection.outlook.de/PowerShell-LiveID -AzureADAuthorizationEndPointUri https://login.microsoftonline.de/common
Photo by Anton Shuvalov on Unsplash

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store