App-only authentication for eDiscovery cmdlets is unsupported: what that means for your automations
25 August 2026 · Samantha Kloos-KilkensA lot of eDiscovery automation runs unattended: a scheduled script that creates compliance searches, places holds or exports results, connected to Security & Compliance PowerShell with a certificate. Microsoft now states plainly that app-only authentication for the eDiscovery cmdlets in Security & Compliance PowerShell is unsupported, and that you should move those automations to Microsoft Graph where you can. The steps to keep certificate-based connections working are still documented, but explicitly as best effort. That's worth acting on before something breaks.
Photo: Getty Images on Unsplash
What exactly is unsupported
New-ComplianceSearch, Start-ComplianceSearch, New-ComplianceSearchAction and Get-ComplianceSearchAction, New-CaseHoldPolicy and Set-CaseHoldPolicy, Invoke-HoldRemovalAction, Invoke-ComplianceSecurityFilterAction and Invoke-ComplianceSearchActionStep, and Microsoft says "including but not limited to". If an unattended script calls any of those, it's in this category."Unsupported" doesn't mean it stops working tomorrow. It means that when it does stop working, or behaves differently after a module update, there's no support case to open. For anything legal or HR depends on, that's not a position you want to be in.
If you have to keep it running for now
- the app registration needs the Exchange.ManageAsApp application permission from Microsoft Exchange Online Protection (not the similarly named Office 365 Exchange Online permission), with admin consent
- the service principal has to be registered with
New-ServicePrincipal, using the object ID from Enterprise applications, not from App registrations - that service principal has to be a member of the eDiscovery Manager role group, which Microsoft calls the validated least-privileged assignment; eDiscovery Administrator isn't an interchangeable alternative here
- connect with ExchangeOnlineManagement 3.10.1 or later and the
-EnableSearchOnlySessionswitch onConnect-IPPSSession
Treat this as a bridge, not a fix. Write down which scripts depend on it, so you know what to move.
Moving to Microsoft Graph
Once that's in place, a first test is simply listing your cases with an app-only connection:
param(
[Parameter(Mandatory = $true)] [string]$TenantId,
[Parameter(Mandatory = $true)] [string]$ClientId,
[Parameter(Mandatory = $true)] [string]$CertificateThumbprint
)
Connect-MgGraph -TenantId $TenantId -ClientId $ClientId -CertificateThumbprint $CertificateThumbprint -NoWelcome
$cases = (Invoke-MgGraphRequest GET "v1.0/security/cases/ediscoveryCases").value
$cases | ForEach-Object { [pscustomobject]@{ Name = $_.displayName; Status = $_.status; Created = $_.createdDateTime } }
Disconnect-MgGraph | Out-Null
Be prepared for this to be a rewrite rather than a translation. The PowerShell cmdlets and the Graph API don't map one to one. Graph works with cases, custodians, searches and review sets, where many older scripts work with loose compliance searches outside a case. That's usually an improvement, because it puts the work where the audit trail and permissions already are, but it means you have to look at what the script is for, not just which cmdlets it calls.
Finding what depends on it
Connect-IPPSSession -CertificateThumbprint or -Certificate. Then check which of those call cmdlets from the list above. The app registrations with Exchange.ManageAsApp are another starting point, because each one is an automation someone set up for a reason.Search your automation accounts and script repositories for
Connect-IPPSSession with a certificate parameter, list every script that also calls a compliance search or hold cmdlet, and give each one an owner and a date to move it to Graph.The script from this post is also on GitHub, in purview-scripts.
Sources
- Assign permissions in eDiscovery: configure app-only authentication for eDiscovery PowerShell (Microsoft Learn)
- App-only authentication for unattended scripts in Exchange Online PowerShell and Security & Compliance PowerShell (Microsoft Learn)
- Set up app-only access for Microsoft Purview eDiscovery (Microsoft Graph)
- Use Microsoft Purview APIs for eDiscovery (Microsoft Learn)
- What's new in Microsoft Purview, August 2026 (Microsoft Learn)