public bool IsCrossForestDomain(string domain) { try { RequestLogger requestLogger = new RequestLogger(); ConfigurationReader.Start(requestLogger); TargetForestConfiguration targetForestConfiguration = TargetForestConfigurationCache.FindByDomain(this.directoryContext.OrganizationId, domain); if (targetForestConfiguration.Exception != null) { this.directoryContext.Errors.Add(ErrorCode.UnexpectedErrorPermanent, string.Empty, string.Format("Cross-forest autodiscover failure for domain {0}", domain), targetForestConfiguration.Exception.ToString()); TraceWrapper.SearchLibraryTracer.TraceDebug <string, LocalizedException>(this.GetHashCode(), "forestConfig.Exception reading address-space for domain {0}, exception {1}.", domain, targetForestConfiguration.Exception); return(false); } } catch (AddressSpaceNotFoundException arg) { TraceWrapper.SearchLibraryTracer.TraceDebug <string, AddressSpaceNotFoundException>(0, "Domain {0} is not recognized as remote forest, exception {1}.", domain, arg); return(false); } TraceWrapper.SearchLibraryTracer.TraceDebug <string>(0, "Domain {0} is recognized as remote forest.", domain); return(true); }
public override AsyncRequestWithQueryList CreateCrossForestAsyncRequestWithAutoDiscoverForRemoteMailbox(ClientContext clientContext, RequestLogger requestLogger, QueryList queryList, TargetForestConfiguration targetForestConfiguration) { return(new ProxyWebRequestWithAutoDiscover(this, clientContext, requestLogger, queryList, targetForestConfiguration, new CreateAutoDiscoverRequestDelegate(AutoDiscoverRequestXmlByUser.Create))); }