Skip to content

/commands/purview/connect-ippssession

Connect-IPPSSession: connect to Security & Compliance PowerShell (Purview)

The commands on this page have not been executed by our verification runner yet.updated
tool
Microsoft Purview (Security & Compliance PowerShell)
versions
ExchangeOnlineManagement 3.10.1
os
windows, linux, macos

Microsoft Purview cmdlets (retention, DLP, sensitivity labels, eDiscovery searches) run in Security & Compliance PowerShell. You connect to it with Connect-IPPSSession, which is part of the same ExchangeOnlineManagement module as Connect-ExchangeOnline:

powershell
Import-Module ExchangeOnlineManagement
Connect-IPPSSession -UserPrincipalName admin@contoso.onmicrosoft.com

For eDiscovery cmdlets (New-ComplianceSearch, Start-ComplianceSearch, New-ComplianceSearchAction) add -EnableSearchOnlySession; it requires module 3.9.0 or later:

powershell
Connect-IPPSSession -UserPrincipalName admin@contoso.onmicrosoft.com -EnableSearchOnlySession

What the module provides offline

Before connecting, the module contains Connect-IPPSSession but none of the Purview cmdlets; they are created by the connection. Checked with module 3.10.1:

powershell
Import-Module ExchangeOnlineManagement
$p = (Get-Command Connect-IPPSSession).Parameters
foreach ($n in 'UserPrincipalName','EnableSearchOnlySession','AppId','CertificateThumbprint','Organization','ConnectionUri','DelegatedOrganization') {
  '{0,-24} {1}' -f $n, $p[$n].ParameterType.Name
}
foreach ($c in 'Get-RetentionCompliancePolicy','Get-DlpCompliancePolicy','Get-Label','New-ComplianceSearch') {
  '{0,-30} available: {1}' -f $c, [bool](Get-Command $c -ErrorAction SilentlyContinue)
}

Connection options

ScenarioCommand
Interactive, with or without MFAConnect-IPPSSession -UserPrincipalName admin@contoso.onmicrosoft.com
eDiscovery cmdletsConnect-IPPSSession -UserPrincipalName admin@contoso.onmicrosoft.com -EnableSearchOnlySession
App-only with a certificateConnect-IPPSSession -AppId APP_ID -CertificateThumbprint THUMBPRINT -Organization contoso.onmicrosoft.com
GCC Highadd -ConnectionUri https://ps.compliance.protection.office365.us/powershell-liveid/
DisconnectDisconnect-ExchangeOnline

For app-only connections the app needs the Microsoft Exchange Online Protection > Exchange.ManageAsApp application permission and a Microsoft Entra role supported by Security & Compliance PowerShell, such as Compliance Administrator. Microsoft states that app-only authentication for eDiscovery cmdlets is unsupported.

Permissions

After you connect, role-based access control decides which cmdlets and parameters exist in the session. Typical roles: Compliance Administrator for retention and DLP, eDiscovery Manager for compliance searches, and the Search And Purge role for New-ComplianceSearchAction -Purge. A cmdlet you have no role for is simply not imported, so it fails with "is not recognized".

Sources