Table of Contents

Class AutodiscoverService

Namespace
Microsoft.Exchange.WebServices.Autodiscover
Assembly
Microsoft.Exchange.WebServices.dll

Represents a binding to the Exchange Autodiscover Service.

public sealed class AutodiscoverService : ExchangeServiceBase
Inheritance
AutodiscoverService
Inherited Members

Constructors

AutodiscoverService()

Initializes a new instance of the AutodiscoverService class.

public AutodiscoverService()

AutodiscoverService(ExchangeVersion)

Initializes a new instance of the AutodiscoverService class.

public AutodiscoverService(ExchangeVersion requestedServerVersion)

Parameters

requestedServerVersion ExchangeVersion

The requested server version.

AutodiscoverService(string)

Initializes a new instance of the AutodiscoverService class.

public AutodiscoverService(string domain)

Parameters

domain string

The domain that will be used to determine the URL of the service.

AutodiscoverService(string, ExchangeVersion)

Initializes a new instance of the AutodiscoverService class.

public AutodiscoverService(string domain, ExchangeVersion requestedServerVersion)

Parameters

domain string

The domain that will be used to determine the URL of the service.

requestedServerVersion ExchangeVersion

The requested server version.

AutodiscoverService(Uri)

Initializes a new instance of the AutodiscoverService class.

public AutodiscoverService(Uri url)

Parameters

url Uri

The URL of the service.

AutodiscoverService(Uri, ExchangeVersion)

Initializes a new instance of the AutodiscoverService class.

public AutodiscoverService(Uri url, ExchangeVersion requestedServerVersion)

Parameters

url Uri

The URL of the service.

requestedServerVersion ExchangeVersion

The requested server version.

Properties

Domain

Gets or sets the domain this service is bound to. When this property is set, the domain name is used to automatically determine the Autodiscover service URL.

public string Domain { get; set; }

Property Value

string

EnableScpLookup

Gets or sets a value indicating whether the AutodiscoverService should perform SCP (ServiceConnectionPoint) record lookup when determining the Autodiscover service URL.

public bool EnableScpLookup { get; set; }

Property Value

bool

GetScpUrlsForDomainCallback

Gets or sets the delegate used to resolve Autodiscover SCP urls for a specified domain.

public Func<string, ICollection<string>> GetScpUrlsForDomainCallback { get; set; }

Property Value

Func<string, ICollection<string>>

IsExternal

Gets a value indicating whether the Autodiscover service that URL points to is internal (inside the corporate network) or external (outside the corporate network).

public bool? IsExternal { get; }

Property Value

bool?

Remarks

IsExternal is null in the following cases:

  • This instance has been created with a domain name and no method has been called,
  • This instance has been created with a URL.

RedirectionUrlValidationCallback

Gets or sets the redirection URL validation callback.

public AutodiscoverRedirectionUrlValidationCallback RedirectionUrlValidationCallback { get; set; }

Property Value

AutodiscoverRedirectionUrlValidationCallback

The redirection URL validation callback.

Url

Gets or sets the URL this service is bound to.

public Uri Url { get; set; }

Property Value

Uri

Methods

GetDomainSettings(IEnumerable<string>, ExchangeVersion?, params DomainSettingName[])

Retrieves the specified settings for a set of domains.

public GetDomainSettingsResponseCollection GetDomainSettings(IEnumerable<string> domains, ExchangeVersion? requestedVersion, params DomainSettingName[] domainSettingNames)

Parameters

domains IEnumerable<string>

The SMTP addresses of the domains.

requestedVersion ExchangeVersion?

Requested version of the Exchange service.

domainSettingNames DomainSettingName[]

The domain setting names.

Returns

GetDomainSettingsResponseCollection

A GetDomainSettingsResponseCollection object containing the responses for each individual domain.

GetDomainSettings(string, ExchangeVersion?, params DomainSettingName[])

Retrieves the specified settings for a domain.

public GetDomainSettingsResponse GetDomainSettings(string domain, ExchangeVersion? requestedVersion, params DomainSettingName[] domainSettingNames)

Parameters

domain string

The domain.

requestedVersion ExchangeVersion?

Requested version of the Exchange service.

domainSettingNames DomainSettingName[]

The domain setting names.

Returns

GetDomainSettingsResponse

A DomainResponse object containing the requested settings for the specified domain.

GetUserSettings(string, params UserSettingName[])

Retrieves the specified settings for single SMTP address.

public GetUserSettingsResponse GetUserSettings(string userSmtpAddress, params UserSettingName[] userSettingNames)

Parameters

userSmtpAddress string

The SMTP addresses of the user.

userSettingNames UserSettingName[]

The user setting names.

Returns

GetUserSettingsResponse

A UserResponse object containing the requested settings for the specified user.

Remarks

This method handles will run the entire Autodiscover "discovery" algorithm and will follow address and URL redirections.

GetUsersSettings(IEnumerable<string>, params UserSettingName[])

Retrieves the specified settings for a set of users.

public GetUserSettingsResponseCollection GetUsersSettings(IEnumerable<string> userSmtpAddresses, params UserSettingName[] userSettingNames)

Parameters

userSmtpAddresses IEnumerable<string>

The SMTP addresses of the users.

userSettingNames UserSettingName[]

The user setting names.

Returns

GetUserSettingsResponseCollection

A GetUserSettingsResponseCollection object containing the responses for each individual user.

TryGetPartnerAccess(string, out ExchangeCredentials, out Uri)

Try to get the partner access information for the given target tenant.

public bool TryGetPartnerAccess(string targetTenantDomain, out ExchangeCredentials partnerAccessCredentials, out Uri targetTenantAutodiscoverUrl)

Parameters

targetTenantDomain string

The target domain or user email address.

partnerAccessCredentials ExchangeCredentials

The partner access credentials.

targetTenantAutodiscoverUrl Uri

The autodiscover url for the given tenant.

Returns

bool

True if the partner access information was retrieved, false otherwise.