Commands › Exchange Online

Set-FederationTrust

Exchange Online ExchangeOnlineManagement Set-*

Modify an existing federation trust.

Quick start script

# Set-FederationTrust — 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-FederationTrust
$before | Format-List

# 3. Make the change (dry run first)
Set-FederationTrust -Identity <FederationTrustIdParameter> -ApplicationUri <String> -PublishFederationCertificate <SwitchParameter> -WhatIf
Set-FederationTrust -Identity <FederationTrustIdParameter> -ApplicationUri <String> -PublishFederationCertificate <SwitchParameter>

# 4. Verify and diff
$after = Get-FederationTrust
Compare-Object ($before | Out-String) ($after | Out-String)

Syntax — 3 parameter sets

ApplicationUri

Set-FederationTrust [-Identity] <FederationTrustIdParameter> -ApplicationUri <String>
 [-Confirm]
 [-DomainController <Fqdn>]
 [-Name <String>]
 [-WhatIf]
 [-PublishFederationCertificate]
 [<CommonParameters>]

PublishFederationCertificate

Set-FederationTrust [-Identity] <FederationTrustIdParameter>
 [-PublishFederationCertificate]
 [-Confirm]
 [-DomainController <Fqdn>]
 [-Name <String>]
 [-WhatIf]
 [<CommonParameters>]

Identity

Set-FederationTrust [-Identity] <FederationTrustIdParameter>
 [-Confirm]
 [-DomainController <Fqdn>]
 [-MetadataUrl <Uri>]
 [-Name <String>]
 [-RefreshMetadata]
 [-Thumbprint <String>]
 [-WhatIf]
 [<CommonParameters>]

Parameters (10)

ParameterTypeRequiredWhat it controls
-Identity FederationTrustIdParameter yes The Identity parameter specifies the name of the federation trust being modified.
-ApplicationUri String yes The ApplicationUri parameter specifies the primary domain used for the federation organization identifier.
-PublishFederationCertificate SwitchParameter yes The PublishFederationCertificate switch specifies the next certificate as the current certificate for the federation trust and publishes it to the Microsoft Federation Gateway. You don't need to specify a value with...
-Confirm SwitchParameter The Confirm switch specifies whether to show or hide the confirmation prompt. How this switch affects the cmdlet depends on whether the cmdlet requires confirmation before proceeding.
-DomainController Fqdn The DomainController parameter specifies the domain controller that's used by this cmdlet to read data from or write data to Active Directory. You identify the domain controller by its fully qualified domain name...
-MetadataUrl Uri The MetadataUrl parameter specifies the URL where WS-FederationMetadata is published by the Microsoft Federation Gateway.
-Name String The Name parameter specifies a name for the federation trust.
-RefreshMetadata SwitchParameter The RefreshMetadata switch specifies that the metadata document and certificate is retrieved again from the Microsoft Federation Gateway. You don't need to specify a value with this switch.
-Thumbprint String The Thumbprint parameter specifies the thumbprint of the X.509 certificate to be configured as the next certificate for the federation trust. After the certificate is deployed on all Exchange servers in the...
-WhatIf SwitchParameter The WhatIf switch shows what the command does without making any changes. You don't need to specify a value with this switch.

Reference facts derived from Microsoft documentation, © Microsoft, licensed CC BY 4.0; restructured with original guidance by serv365.ai.