API Reference
NamingContextService
Centralized helper for deriving well-known naming contexts without binding RootDSE. Uses the current forest's root domain as the base and performs purely string-based computations to avoid contacting unhealthy DCs.
Inheritance
- Object
- NamingContextService
Methods
public static String GetConfigurationNamingContext() #StringReturns CN=Configuration,<forest-root-dn>.
public static String GetDomainNamingContext(String domainName) #StringConverts a domain DNS name to DN (DC=... form). Pass-through for DNs.
Parameters
- domainName System.String
public static String GetForestRootDomainName() #StringReturns the forest root DNS name for the current forest.
public static String GetPartitionsContainer() #StringReturns CN=Partitions,CN=Configuration,<forest-root-dn>.
public static String GetSchemaNamingContext() #StringReturns CN=Schema,CN=Configuration,<forest-root-dn>.
public static Boolean TryGetConfigurationNamingContext(out String configurationNamingContext) #BooleanAttempts to return CN=Configuration,<forest-root-dn>.
Parameters
- configurationNamingContext System.String@
- Resolved configuration naming context when successful.
Returns
true when a valid value could be composed.
public static Boolean TryGetPartitionsContainer(out String partitionsContainer) #BooleanAttempts to return CN=Partitions,CN=Configuration,<forest-root-dn>.
Parameters
- partitionsContainer System.String@
- Resolved partitions container when successful.
Returns
true when a valid value could be composed.
public static Boolean TryGetSchemaNamingContext(out String schemaNamingContext) #BooleanAttempts to return CN=Schema,CN=Configuration,<forest-root-dn>.
Parameters
- schemaNamingContext System.String@
- Resolved schema naming context when successful.
Returns
true when a valid value could be composed.