Commands › Exchange Online

Set-ADSiteLink

Exchange Online ExchangeOnlineManagement Set-*

Assign an Exchange-specific cost to an Active Directory IP site link. You can also use this cmdlet to configure the maximum message size that can pass across an Active Directory IP site link.

Quick start script

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

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

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

Syntax

Set-ADSiteLink [-Identity] <AdSiteLinkIdParameter>
 [-Confirm]
 [-DomainController <Fqdn>]
 [-ExchangeCost <Int32>]
 [-MaxMessageSize <Unlimited>]
 [-Name <String>]
 [-WhatIf]
 [<CommonParameters>]

Parameters (7)

ParameterTypeRequiredWhat it controls
-Identity AdSiteLinkIdParameter yes The Identity parameter specifies the name or GUID of the IP site link you want to modify.
-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...
-ExchangeCost Int32 The ExchangeCost parameter specifies an Exchange-specific cost for the IP site link. This cost is used instead of the Active Directory-assigned cost. To clear the value of the ExchangeCost parameter and revert to...
-MaxMessageSize Unlimited The MaxMessageSize parameter specifies the maximum size of a message that can pass across the Active Directory IP site link. The default value is unlimited.
-Name String The Name parameter specifies a unique name for the IP site link. The name that you assign overwrites the current identity of the IP site link.
-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.