PurviewTroubleshooting

Connect-IPPSSession: fixing Security & Compliance PowerShell connection errors

Install the ExchangeOnlineManagement module, connect to Security & Compliance PowerShell interactively or app-only, and fix the install, connection and eDiscovery session errors.

Security & Compliance PowerShell is where Purview admins script DLP policies, labels, retention and eDiscovery searches, and every session starts with Connect-IPPSSession from the ExchangeOnlineManagement module. When the connection fails, the error rarely says what to change. In this post I'll match the errors Microsoft documents to their causes, then show how to set up interactive and certificate-based connections that keep working.

Errors this guide fixes

  • Please close the current PowerShell session and open a new session using Connect-IPPSSession with the -EnableSearchOnlySession flag.Security & Compliance PowerShell (eDiscovery)
  • The term 'Update-ModuleManifest' is not recognized as the name of a cmdlet, function, script file, or operable program.Connect-IPPSSession
  • The request for the Windows Remote Shell with ShellId <ID> failed because the shell was not found on the server.Connect-IPPSSession
  • The term 'Connect-IPPSSession' is not recognized as the name of a cmdlet, function, script file, or operable program.PowerShell console
  • Files cannot be loaded because running scripts is disabled on this system.Connect-IPPSSession
  • The specified module 'ExchangeOnlineManagement' with PowerShellGetFormatVersion '<version>' isn't supportedInstall-Module / Update-Module
  • No match was found for the specified search criteria and module name 'ExchangeOnlineManagement'.Install-Module
How this guide is organized: Symptoms → Why it happens → How to fix it → Verify the fix → Prevent it next timeFlow diagram of the article's sections in reading order: 1. Symptoms. 2. Why it happens. 3. How to fix it (5 steps: Fix the module and its prerequisites; Connect interactively; Open a search-only session for eDiscovery cmdlets; Set up app-only connections correctly; Fix the network path). 4. Verify the fix. 5. Prevent it next time. Toolbox: Connect-IPPSSession, Update-ModuleManifest, New-ComplianceSearchAction, UseRPSSession, *-ComplianceSearch.1Symptoms2Why it happens3How to fix it4Verify the fix5Prevent it nexttime1Fix the module andits prerequisites2Connectinteractively3Open a search-onlysession for eDisco…4Set up app-onlyconnections corre…5Fix the networkpathTOOLBOXConnect-IPPSSessionUpdate-ModuleManifestNew-ComplianceSearchActionUseRPSSession*-ComplianceSearchHow this guide is organized: Symptoms → Why it happens → How to fix it → Verify the fix → Prevent it next timeFlow diagram of the article's sections in reading order: 1. Symptoms. 2. Why it happens. 3. How to fix it (5 steps: Fix the module and its prerequisites; Connect interactively; Open a search-only session for eDiscovery cmdlets; Set up app-only connections correctly; Fix the network path). 4. Verify the fix. 5. Prevent it next time. Toolbox: Connect-IPPSSession, Update-ModuleManifest, New-ComplianceSearchAction, UseRPSSession, *-ComplianceSearch.1Symptoms2Why it happens3How to fix it1Fix the module and its prerequisites2Connect interactively3Open a search-only session for eDiscoverycmdlets4Set up app-only connections correctly5Fix the network path4Verify the fix5Prevent it next timeTOOLBOXConnect-IPPSSessionUpdate-ModuleManifestNew-ComplianceSearchActionUseRPSSession*-ComplianceSearch
At a glance: how this guide is organized · 5 fix steps · 5 key tools

Symptoms#

One of these appears while you install the module, connect, or run your first cmdlet:

Text
Files cannot be loaded because running scripts is disabled on this system. Provide a valid certificate with which to sign the files.

The specified module 'ExchangeOnlineManagement' with PowerShellGetFormatVersion '<version>' isn't supported by the current version of PowerShellGet. Get the latest version of the PowerShellGet module to install this module, 'ExchangeOnlineManagement'.

No match was found for the specified search criteria and module name 'ExchangeOnlineManagement'. Try running Get-PSRepository to see all available registered module repositories.

The term 'Connect-IPPSSession' is not recognized as the name of a cmdlet, function, script file, or operable program.

The term 'Update-ModuleManifest' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.

The request for the Windows Remote Shell with ShellId <ID> failed because the shell was not found on the server.

Please close the current PowerShell session and open a new session using Connect-IPPSSession with the -EnableSearchOnlySession flag. This requires using ExchangeOnlineManagement v3.9.0 or higher.

Two quieter symptoms: an unattended script opens a sign-in prompt, or you connect fine but a specific cmdlet is missing. The second one is a permissions problem, covered in my guide to Purview roles and role groups.

Why it happens#

Matching a Connect-IPPSSession error to its fixWhat does the error point to? if Module or scripts: Fix the module and PowerShellGet (Allow signed scripts, update PowerShellGet, re-register PSGallery); if Sign-in or ShellId: Does the error say the ShellId wasn't found? if Yes: Keep one client IP address (Use a SNAT pool with a single IP address); if No, a prompt: Check the app-only setup (API permission, a supported role and a non-CNG certificate); if A cmdlet: Does the error ask for the -EnableSearchOnlySession flag? if Yes: Reconnect in a search-only session (Needs module 3.9.0 or later and the switch); if No, it's missing: Check the account's role groups (A missing cmdlet is a permissions problem)What does the error point to?FIXFix the moduleandPowerShellGetAllow signed scripts,updatePowerShellGet,re-register PSGalleryModule or scriptsDoes the error say the ShellIdwasn't found?FIXKeep one client IPaddressUse a SNAT poolwith a single IPaddressYesFIXCheck theapp-only setupAPI permission, asupported role and anon-CNG certificateNo, a promptSign-in or ShellIdDoes the error ask for the-EnableSearchOnlySessionflag?FIXReconnect in asearch-onlysessionNeeds module 3.9.0or later and theswitchYesFIXCheck theaccount's rolegroupsA missing cmdlet is apermissions problemNo, it's missingA cmdletMatching a Connect-IPPSSession error to its fixWhat does the error point to? if Module or scripts: Fix the module and PowerShellGet (Allow signed scripts, update PowerShellGet, re-register PSGallery); if Sign-in or ShellId: Does the error say the ShellId wasn't found? if Yes: Keep one client IP address (Use a SNAT pool with a single IP address); if No, a prompt: Check the app-only setup (API permission, a supported role and a non-CNG certificate); if A cmdlet: Does the error ask for the -EnableSearchOnlySession flag? if Yes: Reconnect in a search-only session (Needs module 3.9.0 or later and the switch); if No, it's missing: Check the account's role groups (A missing cmdlet is a permissions problem)What does the error point to?Module or scriptsFIXFix the module and PowerShellGetAllow signed scripts, update PowerShellGet,re-register PSGallerySign-in or ShellIdDoes the error say the ShellId wasn'tfound?YesFIXKeep one client IP addressUse a SNAT pool with a single IP addressNo, a promptFIXCheck the app-only setupAPI permission, a supported role and a non-CNGcertificateA cmdletDoes the error ask for the-EnableSearchOnlySession flag?YesFIXReconnect in a search-only sessionNeeds module 3.9.0 or later and the switchNo, it's missingFIXCheck the account's role groupsA missing cmdlet is a permissions problem
Figure 1 · Decision tree Matching a Connect-IPPSSession error to its fix. Start from what the error points to and follow the branch to the fix. A cmdlet that is simply missing after a good connection is a permissions problem.

Since October 2023, Security & Compliance PowerShell accepts only REST API connections; remote PowerShell (RPS) connections are deprecated, and module version 3.9.2 deprecated the UseRPSSession switch. REST connections don't need Basic authentication in WinRM, but they do depend on a healthy PowerShellGet setup and a current module. Most errors map to one cause:

ErrorCause
Running scripts is disabledThe execution policy blocks the module's scripts.
PowerShellGetFormatVersion / No match was foundAn old PowerShellGet module, or PSGallery isn't registered as a repository.
Connect-IPPSSession not recognizedThe module isn't installed for this user or PowerShell edition, or isn't loaded.
Update-ModuleManifest not recognizedPowerShellGet or PackageManagement is missing; REST connections need both. Preview versions of either can also break connections.
ShellId not found on the serverYour client IP address changed during the connection, typically behind a SNAT pool with several addresses.
Use the -EnableSearchOnlySession flageDiscovery cmdlets (*-ComplianceSearch, New-ComplianceSearchAction) need module 3.9.0 or later and a session opened with that switch.

Platform matters too: Connect-IPPSSession isn't available in PowerShell 7 on macOS or Linux, and connect and disconnect commands are likely to fail if the profile path of the signed-in account contains special PowerShell characters such as $.

How to fix it#

1. Fix the module and its prerequisites#

PowerShell
# Elevated session: allow signed remote scripts
Set-ExecutionPolicy RemoteSigned

# Preview versions of these modules can break connections
Get-InstalledModule PackageManagement -AllVersions; Get-InstalledModule PowerShellGet -AllVersions

# "No match was found": re-register the PowerShell Gallery
Register-PSRepository -Default

# Install, or update with the same scope you installed with
Install-Module -Name ExchangeOnlineManagement -Scope CurrentUser
Update-Module -Name ExchangeOnlineManagement -Scope CurrentUser
Get-InstalledModule ExchangeOnlineManagement | Format-List Name, Version, InstalledLocation

For the PowerShellGetFormatVersion error, update PowerShellGet first, then close and reopen the window before you retry. In PowerShell 7, module 3.10.0 and later needs PowerShell 7.6.0 or later, and versions 3.5.0 to 3.9.2 need 7.4.0 or later; Windows PowerShell 5.1 supports every version. Microsoft Learn lists 3.10.1 as the current release.

2. Connect interactively#

PowerShell
Connect-IPPSSession -UserPrincipalName admin@contoso.onmicrosoft.com

# Microsoft 365 GCC High
Connect-IPPSSession -UserPrincipalName admin@contoso.us `
  -ConnectionUri https://ps.compliance.protection.office365.us/powershell-liveid/ `
  -AzureADAuthorizationEndpointUri https://login.microsoftonline.us/organizations

# Web Account Manager (WAM) sign-in problems on Windows
Connect-IPPSSession -UserPrincipalName admin@contoso.onmicrosoft.com -DisableWAM

Commercial and GCC tenants need no ConnectionUri; the default endpoint is correct. Don't use -Credential for accounts with MFA. If sign-in works but the session is refused, check that the account is allowed to use PowerShell: in Exchange Online PowerShell, Get-User admin@contoso.com | Format-List RemotePowerShellEnabled should return True.

3. Open a search-only session for eDiscovery cmdlets#

Close the current session, then reconnect with the switch:

PowerShell
Disconnect-ExchangeOnline -Confirm:$false
Connect-IPPSSession -UserPrincipalName admin@contoso.onmicrosoft.com -EnableSearchOnlySession
Get-ComplianceSearch | Format-Table Name, Status

App-only authentication isn't supported for the eDiscovery cmdlets. Existing automations that still use it should run module 3.10.1 or later with -EnableSearchOnlySession, but Microsoft treats that as best effort and recommends moving to Microsoft Graph APIs where they exist.

4. Set up app-only connections correctly#

  • API permission: add the application permission Microsoft Exchange Online Protection › Exchange.ManageAsApp and grant admin consent. The Office 365 Exchange Online permission is for Connect-ExchangeOnline; an app that connects to both needs both.
  • Role: assign the app a supported Microsoft Entra role (Compliance Administrator, Security Administrator, Security Reader or Global Reader), or create a service principal with New-ServicePrincipal and add it to a role group with Add-RoleGroupMember.
  • Certificate: CNG certificates aren't supported. Create the key with a CSP provider (for example New-SelfSignedCertificate ... -KeySpec KeyExchange) and upload the .cer file to the app registration.
  • Parameters: -Organization must be the primary .onmicrosoft.com domain, and -CertificateThumbprint works only on Windows with the certificate in the user store.
PowerShell
Connect-IPPSSession -AppId "<application (client) ID>" `
  -CertificateThumbprint "<thumbprint>" -Organization "contoso.onmicrosoft.com"

If this command still shows a sign-in prompt, Microsoft's documented workaround is to run $Global:IsWindows = $true before Connect-IPPSSession. My Exchange Online PowerShell V3 guide walks through creating the certificate and app registration.

5. Fix the network path#

  • For the ShellId error, use a SNAT pool with a single IP address, or force one address for connections to the Security & Compliance endpoint.
  • -PSSessionOption works only together with -UseRPSSession, so proxy settings passed that way have no effect on REST connections. Allow the endpoints through the proxy instead; Microsoft also lists TCP port 80 as a requirement.
  • Still stuck? Capture logs for support: Connect-IPPSSession -UserPrincipalName admin@contoso.onmicrosoft.com -EnableErrorReporting -LogDirectoryPath C:\Temp\EXOLogs -LogLevel All.

Verify the fix#

  • Get-ConnectionInformation returns the Security & Compliance connection.
  • A quick cmdlet such as Get-RetentionCompliancePolicy returns results without errors.
  • In a search-only session, Get-ComplianceSearch runs without the EnableSearchOnlySession message.
  • App-only scripts run without a prompt, and the app's sign-ins appear under service principal sign-ins in the Microsoft Entra sign-in logs.

Prevent it next time#

  • Update the module on a schedule and read the release notes first; 3.10.0 raised the PowerShell 7 minimum to 7.6.
  • End every script with Disconnect-ExchangeOnline. Closing the window without disconnecting can use up your available sessions until they expire.
  • Remove -UseRPSSession and -PSSessionOption from old scripts, and use -CommandName to import only the cmdlets a job needs.
  • Give automation apps the narrowest role that works, not Global Administrator.
  • For Exchange Online module errors, see the Exchange Online PowerShell errors quick reference.

References#

Written and checked against current Microsoft Learn documentation. Test changes with a pilot group before rolling them out to everyone, and if an admin center path has moved since, search for the setting name instead.

Spotted a mistake, or did this fix work differently for you? Email me or message me on LinkedIn — corrections are credited in the article.

Written by

Omer Eltayeb

Intune Subject Matter Expert in Cairo, Egypt, former Microsoft Cloud Solutions Architect, Microsoft Certified Trainer and Microsoft Innovative Educator Expert (2024–26) and Microsoft Elevate Educator Expert (2026–27). I share practical, step-by-step guides, study plans, scripts and toolkits for Microsoft Intune, Configuration Manager, Microsoft Entra ID, Microsoft Defender, Exchange and Microsoft 365 with the community.

Microsoft Certified Trainer (MCT) 2026Microsoft Innovative Educator Expert 2025–2026Microsoft Elevate Educator Expert 2026–2027ISC2 Certified Information Systems Security Professional (CISSP)Microsoft 365 Certified: Enterprise Administrator Expert (MS-102)