Commands › Exchange Online

New-AuthServer

Exchange Online ExchangeOnlineManagement New-*

Create an authorization server object in Microsoft Exchange and specify its AuthMetadataUrl. Exchange honors tokens issued by the authorization server for access by a partner application.

Quick start script

# New-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)
New-AuthServer -Name <String> -AuthMetadataUrl <String> -Type <AuthServerType> -WhatIf
New-AuthServer -Name <String> -AuthMetadataUrl <String> -Type <AuthServerType>

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

Syntax — 3 parameter sets

AuthMetadataUrl

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

NativeClientAuthServer

New-AuthServer [-Name] <String> -AuthMetadataUrl <String> -Type <AuthServerType>
 [-TrustAnySSLCertificate]
 [-Confirm]
 [-DomainController <Fqdn>]
 [-DomainName <MultiValuedProperty>]
 [-Enabled <Boolean>]
 [-WhatIf]
 [<CommonParameters>]

AppSecret

New-AuthServer [-Name] <String> -Type <AuthServerType>
 [-ApplicationIdentifier <String>]
 [-Confirm]
 [-DomainController <Fqdn>]
 [-DomainName <MultiValuedProperty>]
 [-Enabled <Boolean>]
 [-WhatIf]
 [<CommonParameters>]

Parameters (11)

ParameterTypeRequiredWhat it controls
-Name String yes 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 (").
-AuthMetadataUrl String yes The AuthMetadataUrl parameter specifies the URL for the Microsoft 365 authorization server for your cloud-based organization.
-Type AuthServerType yes The Type parameter specifies the type of authorization tokens that are issued by the authorization server. Valid values are:
-ApplicationIdentifier String This parameter is available in the April 18, 2025 Hotfix update (HU) for Exchange 2019 CU15 and Exchange 2016 CU23.
-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. Valid values are:
-GraphBaseUrl String {{ Fill GraphBaseUrl Description }}
-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.