Applies to: Exchange Server 2007
Topic Last Modified: 2007-06-11

Use the Set-AdSite cmdlet to configure an Active Directory directory service site as a hub site to override the default message routing behavior of a computer that has the Hub Transport server role installed.


Set-AdSite -Identity <AdSiteIdParameter> [-DomainController <Fqdn>] [-HubSiteEnabled <$true | $false>] [-Name <String>]
Set-AdSite [-DomainController <Fqdn>] [-HubSiteEnabled <$true | $false>] [-Instance <ADSite>] [-Name <String>]


Parameter Required Type Description




Use the Identity parameter to specify the identity of the Active Directory site that you want to modify. The identity can be expressed as a GUID or by using the Active Directory site name. If the site name includes spaces, enclose the entry in double quotation marks.




Use the DomainController parameter to specify the host name or fully qualified domain name (FQDN) of the domain controller that will write this change to Active Directory.




Use the HubSiteEnabled parameter to specify whether this site will act as a hub site. The default value is $false.




Use the Instance parameter to pass a complete object to the command to be processed. It is mainly used in scripts where a complete object must be passed to the command.




Use the Name parameter to modify the current name of the Active Directory site. You must have Enterprise Administrator rights to use this parameter.

Detailed Description

Microsoft Exchange 2007 Hub Transport servers use Active Directory sites and the costs that are assigned to the Active Directory site links to determine the least cost routing path from each Hub Transport server in the organization to every other Hub Transport server in the organization. After the least cost routing path is determined, the source Hub Transport servers relay messages directly to the destination Hub Transport servers. By default, the Hub Transport servers that are located in Active Directory sites along the path between the source server and the destination server do not process or relay the messages in any way.

You can use the Set-AdSite cmdlet to override this behavior by setting an Active Directory site as a hub site. When a hub site exists along the least cost routing path between two Hub Transport servers, the messages are routed to the hub site for processing before they are relayed to the destination server.

To run the Set-AdSite cmdlet, the account you use must be delegated the following:

  • Exchange Organization Administrator role

For more information about permissions, delegating roles, and the rights that are required to administer Exchange Server 2007, see Permission Considerations.

Input Types

Return Types


Error Description




Exceptions Description




The following code example sets the Active Directory site that is named Default-First-Site-Name as a hub site.

Copy Code
Set-AdSite -Identity Default-First-Site-Name -HubSiteEnabled $true