Parent Category: главный раздел
Category: Exchange
Hits: 3801

Autodiscover is a web service running on Client Access servers that, as the name suggests, allows compatible client software to automatically discover a user’s mailbox settings by looking them up in Active Directory.

But first the client needs to locate a Client Access server to connect to for Autodiscover requests. Internal clients (eg Outlook 2007/2010 running on domain-joined workstations) perform a lookup in Active Directory for which Client Access servers have an Autodiscover Site Scope configured for the Active Directory Site they are currently located in.

If the client can’t determine which Site it is in (eg the subnet is not defined as one of the Site boundaries), or there is no Client Access server explicitly configured for that Site, then the client chooses a Client Access server at random.

The risk here is that the client will choose a Client Access server that is not the most ideal one in terms of bandwidth and latency. To resolve this you can configure what is referred to as “site affinity” by setting the Autodiscover Site Scope on Client Access servers. This makes sure that clients will connect to the closest Autodiscover instance.

You can see the current Autodiscover Site Scope for all of your Client Access servers by running this command in the Exchange Management Shell.

[PS] C:\>Get-ClientAccessServer | ft name,autodiscoversitescope

Name                                                        AutoDiscoverSiteScope
----                                                        ---------------------
AUSYDEXC01                                                  {au-Sydney}
USNYCEXC01                                                  {us-NewYork}
EULONEXC01                                                  {eu-London}

Let’s say for example there is another AD Site of au-Brisbane and users there connect to mailboxes hosted in the au-Sydney site. When these Brisbane Outlook 2007/2010 clients look for an Autodiscover server to connect to it is possible they will choose the New York or London server which have a slower connection over the WAN.

To add the au-Brisbane site to the Autodiscover Site Scope of the Sydney Client Access server we can run the following commands. Because this is a multi-value attribute we have to specify all of the sites in scope, not just the one that is being added. If this was a long list of sites it would be tedious to type out manually, so instead we can first retrieve the current list of sites into an array.

[PS] C:\>$sitescope = (Get-ClientAccessServer AUSYDEXC01).autodiscoversitescope

[PS] C:\>$sitescope
au-Sydney

Next we add the new site to the array.

[PS] C:\>$sitescope += "au-Brisbane"

[PS] C:\>$sitescope
au-Sydney
au-Brisbane

Finally we update the Client Access server with the new site scope settings.

[PS] C:\>Set-ClientAccessServer AUSYDEXC01 -AutoDiscoverSiteScope $sitescope

If there were multiple Client Access servers in the au-Sydney site we could update them all at once with the following commands.

[PS] C:\>$sydneycas = Get-ExchangeServer | where {$_.Site -like "*au-Sydney" -AND $_.IsClientAccessServer -eq $true}

[PS] C:\>$sydneycas | Set-ClientAccessServer -AutoDiscoverSiteScope $scope

You can see the result of the change by retrieving the site scopes again.

[PS] C:\>Get-ClientAccessServer | ft name,autodiscoversitescope

Name                                                        AutoDiscoverSiteScope
----                                                        ---------------------
AUSYDEXC01                                                  {au-Brisbane,au-Sydney}
USNYCEXC01                                                  {us-NewYork}
EULONEXC01                                                  {eu-London}

Note that Outlook clients will connect to Autodiscover using SSL so you must correctly configure an SSL certificate for the Client Access servers.