Commands › Exchange Online
Disconnect-ExchangeOnline
For more information, see About the Exchange Online PowerShell module. Use the Disconnect-ExchangeOnline cmdlet in the Exchange Online PowerShell module to disconnect the connections that you created using the Connect-ExchangeOnline or Connect-IPPSSession cmdlets.
Quick start script
# Disconnect-ExchangeOnline — quick start (serv365.ai)
# 1. Connect (app-only shown; interactive: omit the certificate parameters)
Connect-ExchangeOnline -CertificateThumbprint $thumb -AppId $appId -Organization $org
# 2. Run and inspect
Disconnect-ExchangeOnline -ConnectionId <String[]> -ModulePrefix <String[]> | Format-List
# 3. Export for evidence / drift tracking
Disconnect-ExchangeOnline | Export-Clixml .\ExchangeOnline-$(Get-Date -Format yyyyMMdd).xml
Syntax — 3 parameter sets
DefaultParameterSet (Default)
Disconnect-ExchangeOnline
[-Confirm]
[-WhatIf]
[<CommonParameters>]
ConnectionId
Disconnect-ExchangeOnline -ConnectionId <String[]>
[-Confirm]
[-WhatIf]
[<CommonParameters>]
ModulePrefix
Disconnect-ExchangeOnline -ModulePrefix <String[]>
[-Confirm]
[-WhatIf]
[<CommonParameters>]
Parameters (4)
Reference facts derived from Microsoft documentation, © Microsoft, licensed CC BY 4.0; restructured with original guidance by serv365.ai.