Commands › Exchange Online

Set-AuthServer

Exchange Online ExchangeOnlineManagement Set-*

Configure an authorization server that partner applications can use to obtain tokens recognized by Microsoft Exchange.

Quick start script

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

# 3. Make the change (dry run first)
Set-AuthServer -Identity <AuthServerIdParameter> -WhatIf
Set-AuthServer -Identity <AuthServerIdParameter>

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

Syntax — 4 parameter sets

AuthMetadataUrl

Set-AuthServer [-Identity] <AuthServerIdParameter>
 [-AuthMetadataUrl <String>]
 [-GraphBaseUrl <String>]
 [-TrustAnySSLCertificate]
 [-Confirm]
 [-DomainController <Fqdn>]
 [-DomainName <MultiValuedProperty>]
 [-Enabled <Boolean>]
 [-Name <String>]
 [-WhatIf]
 [<CommonParameters>]

NativeClientAuthServer

Set-AuthServer [-Identity] <AuthServerIdParameter>
 [-AuthMetadataUrl <String>]
 [-IsDefaultAuthorizationEndpoint <Boolean>]
 [-TrustAnySSLCertificate]
 [-Confirm]
 [-DomainController <Fqdn>]
 [-DomainName <MultiValuedProperty>]
 [-Enabled <Boolean>]
 [-Name <String>]
 [-WhatIf]
 [<CommonParameters>]

RefreshAuthMetadata

Set-AuthServer [-Identity] <AuthServerIdParameter>
 [-RefreshAuthMetadata]
 [-Confirm]
 [-DomainController <Fqdn>]
 [-DomainName <MultiValuedProperty>]
 [-Enabled <Boolean>]
 [-Name <String>]
 [-WhatIf]
 [<CommonParameters>]

AppSecret

Set-AuthServer [-Identity] <AuthServerIdParameter>
 [-ApplicationIdentifier <String>]
 [-Confirm]
 [-DomainController <Fqdn>]
 [-DomainName <MultiValuedProperty]>]
 [-Enabled <Boolean>]
 [-Name <String>]
 [-WhatIf]
 [<CommonParameters>]

Parameters (13)

ParameterTypeRequiredWhat it controls
-Identity AuthServerIdParameter yes The Identity parameter specifies the authorization server object that you want to modify. You can use any value that uniquely identifies the authorization server. For example:
-ApplicationIdentifier String This parameter is available in the April 18, 2025 Hotfix update (HU) for Exchange 2019 CU15 and Exchange 2016 CU23.
-AuthMetadataUrl String The AuthMetadataUrl parameter specifies the URL of the authorization server. This can be the AuthMetadataUrl of your Exchange Online organization.
-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...
-DomainName MultiValuedProperty This parameter is available only in Exchange Server 2016 (CU18 or higher) and Exchange Server 2019 (CU7 or higher).
-Enabled Boolean The Enabled parameter specifies whether the authorization server is enabled. Only enabled authorization servers can issue and accept tokens. Disabling the authorization server prevents any partner applications...
-GraphBaseUrl String {{ Fill GraphBaseUrl Description }}
-IsDefaultAuthorizationEndpoint Boolean The IsDefaultAuthorizationEndpoint parameter specifies whether this server is the default authorization endpoint. Valid values are:
-Name String The Name parameter specifies a unique name for the authorization server object. The maximum length is 64 characters. If the value contains spaces, enclose the value in quotation marks (").
-RefreshAuthMetadata SwitchParameter The RefreshAuthMetadata switch specifies whether Exchange should refresh the auth metadata from the specified URL. You don't need to specify a value with this switch.
-TrustAnySSLCertificate SwitchParameter The TrustAnySSLCertificate switch allows Exchange to accept certificates from untrusted certification authorities (CAs). You don't need to specify a value with this switch.
-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.