Microsoft Purview (Security & Compliance PowerShell) Error Messages
Retention, DLP, eDiscovery and sensitivity labels through Connect-IPPSSession.All Microsoft Purview (Security & Compliance PowerShell) pages
- Please close the current PowerShell session ... Connect-IPPSSession with the -EnableSearchOnlySession flagSince August 2025 New-ComplianceSearch and the other eDiscovery cmdlets need module 3.9.0+ and Connect-IPPSSession -EnableSearchOnlySession in a new session.
- Retention policy error: We couldn't find this location (FailedToOpenContainer)A location in the retention policy no longer exists (FailedToOpenContainer). Remove it with Set-RetentionCompliancePolicy, then use -RetryDistribution.
- Retention policy stuck in PendingDeletion: Remove-RetentionCompliancePolicy -ForceDeletionA Purview retention policy stuck in PendingDeletion had a failed deletion. Connect-IPPSSession, then run Remove-RetentionCompliancePolicy with -ForceDeletion.
- The term 'Get-RetentionCompliancePolicy' is not recognized as the name of a cmdletPurview cmdlets such as Get-RetentionCompliancePolicy, Get-DlpCompliancePolicy and Get-Label exist only after Connect-IPPSSession, not Connect-ExchangeOnline.