App-only authentication for eDiscovery cmdlets is unsupported: what that means for your automations

25 August 2026 · Samantha Kloos-Kilkens

A 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.

A bridge under construction over open water Photo: Getty Images on Unsplash

What exactly is unsupported

App-only authentication itself is fine for most of Security & Compliance PowerShell. What's unsupported is using it for the eDiscovery cmdlets. The list in the app-only authentication article includes 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

Microsoft documents what a certificate-based connection for eDiscovery needs, for existing automations only. In short:
  • 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 -EnableSearchOnlySession switch on Connect-IPPSSession
The troubleshooting hints are useful: an HTTP 401 on connect usually means the Exchange.ManageAsApp permission or its consent is missing, and a connection that works but doesn't know the eDiscovery cmdlets points at the service principal registration or the role group membership.

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

The eDiscovery APIs in Microsoft Graph support app-only access, and that's the supported route. One catch: app-only access to the Graph eDiscovery APIs needs premium eDiscovery features (E5, the Purview Suite or the eDiscovery and Audit add-on). In an E3 tenant Graph only gives you delegated access, so for an unattended script there's no supported app-only option left. Setting it up takes a few more steps than a certificate connection to PowerShell, because the app needs both Graph permissions and a place in Purview's own permission model: you register the app, give it the application permission eDiscovery.Read.All or eDiscovery.ReadWrite.All with admin consent, register its service principal in Purview and add it to the eDiscovery Manager role group and as an eDiscovery case admin. Microsoft has a step-by-step article for this.

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
If that returns your cases, the authentication and Purview side are right, and you can start rebuilding the actual work: searches, holds and exports are all part of the case model in Graph.

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

The hard part in most environments isn't the migration, it's finding the scripts. Look in the obvious places: scheduled tasks on management servers, Azure Automation runbooks, and pipelines that connect with 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.

Written by an Argus IT expert

Want an expert like this in your team, or work like this yourself in security, IAM or cloud?

Samantha Kloos-Kilkens

Samantha Kloos-Kilkens

Sam has worked in security and identity for more than ten years, eight of them at Microsoft in the Identity and Network Access product group. She founded Argus IT in 2023 and has a soft spot for the hidden gems in Entra ID. CISSP, CCSP, CISM, CCSK and Microsoft Certified Trainer.

Stay in the Loop

Subscribe to our newsletter for a friendly nudge whenever we publish a new article or have news to share.