Commands › Exchange Online
Remove-FederatedDomain
Remove a federated domain from the federated organization identifier in the federation trust for the Exchange organization. If you remove a domain configured for federated sharing, federated sharing for that domain is disabled. For more information, see Federation.
Quick start script
# Remove-FederatedDomain — quick start (serv365.ai)
# 1. Connect (app-only shown; interactive: omit the certificate parameters)
Connect-ExchangeOnline -CertificateThumbprint $thumb -AppId $appId -Organization $org
# 2. Capture the current state first — you cannot roll back what you never recorded
$before = Get-FederatedDomain
$before | Format-List
# 3. Make the change (dry run first)
Remove-FederatedDomain -DomainName <SmtpDomain> -WhatIf
Remove-FederatedDomain -DomainName <SmtpDomain>
# 4. Verify and diff
$after = Get-FederatedDomain
Compare-Object ($before | Out-String) ($after | Out-String)
Syntax
Remove-FederatedDomain [[-Identity] <OrganizationIdParameter>] -DomainName <SmtpDomain>
[-Confirm]
[-DomainController <Fqdn>]
[-Force]
[-WhatIf]
[<CommonParameters>]
Parameters (6)
Reference facts derived from Microsoft documentation, © Microsoft, licensed CC BY 4.0; restructured with original guidance by serv365.ai.