Commands › Exchange Online

Set-AcceptedDomain

Exchange Online ExchangeOnlineManagement Set-*

Modify existing accepted domains in your organization. An accepted domain is any SMTP namespace for which an Exchange organization sends and receives email.

Quick start script

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

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

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

Syntax

Set-AcceptedDomain [-Identity] <AcceptedDomainIdParameter>
 [-AddressBookEnabled <Boolean>]
 [-CanHaveCloudCache <Boolean>]
 [-Confirm]
 [-DomainController <Fqdn>]
 [-DomainType <AcceptedDomainType>]
 [-EnableNego2Authentication <Boolean>]
 [-MakeDefault <Boolean>]
 [-MailFlowRegion <String>]
 [-MatchSubDomains <Boolean>]
 [-Name <String>]
 [-OutboundOnly <Boolean>]
 [-PendingCompletion <Boolean>]
 [-PendingRemoval <Boolean>]
 [-SendingFromDomainDisabled <Boolean>]
 [-SendingToDomainDisabled <Boolean>]
 [-WhatIf]
 [<CommonParameters>]

Parameters (17)

ParameterTypeRequiredWhat it controls
-Identity AcceptedDomainIdParameter yes The Identity parameter specifies the accepted domain you want to modify. You can use any value that uniquely identifies the accepted domain object. For example, you can use the name, GUID or distinguished name (DN)...
-AddressBookEnabled Boolean This parameter is available only in on-premises Exchange.
-CanHaveCloudCache Boolean This parameter is available only in the cloud-based service.
-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 This parameter is available only in on-premises Exchange.
-DomainType AcceptedDomainType The DomainType parameter specifies the accepted domain type. Valid values are:
-EnableNego2Authentication Boolean This parameter is available only in the cloud-based service.
-MakeDefault Boolean This parameter is available only in on-premises Exchange.
-MailFlowRegion String This parameter is available only in the cloud-based service.
-MatchSubDomains Boolean The MatchSubDomains parameter enables mail to be sent by and received from users on any subdomain of this accepted domain. The default value is $false.
-Name String This parameter is available only in on-premises Exchange.
-OutboundOnly Boolean This parameter is available only in the cloud-based service.
-PendingCompletion Boolean This parameter is available only in on-premises Exchange.
-PendingRemoval Boolean This parameter is available only in on-premises Exchange.
-SendingFromDomainDisabled Boolean This parameter is available only in the cloud-based service.
-SendingToDomainDisabled Boolean This parameter is available only in the cloud-based service.
-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.