public static void SetSharedConfigDC(string partitionFqdn, string serverName, int port) { using (ServiceTopologyProvider serviceTopologyProvider = new ServiceTopologyProvider()) { serviceTopologyProvider.SetConfigDC(partitionFqdn, serverName, port); } }
private static TopologyProvider InitializeInstance() { ExTraceGlobals.TopologyProviderTracer.TraceDebug(0L, "Starting InitializeInstance and waiting for the lock"); TopologyProvider result; lock (TopologyProvider.instanceLockRoot) { int adamPort; switch (TopologyProvider.SelectTopologyMode(out adamPort)) { case TopologyMode.ADTopologyService: { ServiceTopologyProvider serviceTopologyProvider = new ServiceTopologyProvider(); serviceTopologyProvider.SuppressDisposeTracker(); TopologyProvider.staticInstance = serviceTopologyProvider; break; } case TopologyMode.Adam: TopologyProvider.staticInstance = new AdamTopologyProvider(adamPort); break; case TopologyMode.Ldap: TopologyProvider.staticInstance = new LdapTopologyProvider(); break; } ExTraceGlobals.TopologyProviderTracer.TraceDebug <int>(0L, "TopologyProvider::InitializeInstance created {0}", (int)TopologyProvider.CurrentTopologyMode); result = TopologyProvider.staticInstance; } return(result); }
public static string GetSharedConfigDC() { string configDC; using (ServiceTopologyProvider serviceTopologyProvider = new ServiceTopologyProvider()) { configDC = serviceTopologyProvider.GetConfigDC(false); } return(configDC); }
private static TopologyMode SelectTopologyMode(out int adamPort) { adamPort = 0; if (AdamTopologyProvider.CheckIfAdamConfigured(out adamPort)) { return(TopologyMode.Adam); } if (TopologyProvider.userSetTopologyMode != null) { return(TopologyProvider.userSetTopologyMode.Value); } if (ServiceTopologyProvider.IsAdTopologyServiceInstalled()) { return(TopologyMode.ADTopologyService); } return(TopologyMode.Ldap); }
public static string GetConfigDC(string partitionFqdn, string serverName) { if (!Globals.IsDatacenter) { ExTraceGlobals.ADTopologyTracer.TraceDebug <string, string>(0L, "ADSession::GetConfigDC '{0}' will use local forest '{1}'", partitionFqdn, TopologyProvider.LocalForestFqdn); partitionFqdn = TopologyProvider.LocalForestFqdn; } string fqdn; using (ServiceTopologyProvider serviceTopologyProvider = new ServiceTopologyProvider(serverName)) { ADServerInfo configDCInfo = serviceTopologyProvider.GetConfigDCInfo(partitionFqdn, false); if (configDCInfo == null) { throw new ADTransientException(DirectoryStrings.ExceptionADTopologyUnexpectedError(serverName, string.Empty)); } fqdn = configDCInfo.Fqdn; } return(fqdn); }