GetAutodiscoverServiceUrls method

List<Uri?> GetAutodiscoverServiceUrls(
  1. String domainName,
  2. OutParam<int> scpHostCountOutParam
)
Defaults the get autodiscover service urls for domain. Name of the domain. Gets the list of autodiscover service URLs. Domain name. Count of hosts found via SCP lookup.

Implementation

//        /* private */ List<String> DefaultGetScpUrlsForDomain(String domainName)
//        {
//            DirectoryHelper helper = new DirectoryHelper(this);
//            return helper.GetAutodiscoverScpUrlsForDomain(domainName);
//        }

/// <summary>
/// Gets the list of autodiscover service URLs.
/// </summary>
/// <param name="domainName">Domain name.</param>
/// <param name="scpHostCount">Count of hosts found via SCP lookup.</param>
/// <returns>List of Autodiscover URLs.</returns>
List<Uri?> GetAutodiscoverServiceUrls(
  String domainName,
  OutParam<int> scpHostCountOutParam,
) {
  List<Uri?> urls = <Uri?>[];

  if (_enableScpLookup) {
    // Get SCP URLs
    throw UnimplementedError("Unimplemented ScpLookup");
    //                Func<string, ICollection<String>> callback = this.GetScpUrlsForDomainCallback ?? this.DefaultGetScpUrlsForDomain;
    //                List<String> scpUrls = callback(domainName);
    //                for (String str in scpUrls)
    //                {
    //                    urls.add(Uri.parse(str));
    //                }
  }

  scpHostCountOutParam.param = urls.length;

  // As a fallback, add autodiscover URLs base on the domain name.
  urls.add(
    Uri.parse(_AutodiscoverLegacyHttpsUrl.replaceAll("{0}", domainName)),
  );
  urls.add(
    Uri.parse(
      _AutodiscoverLegacyHttpsUrl.replaceAll(
        "{0}",
        "autodiscover.$domainName",
      ),
    ),
  );

  return urls;
}