internal static bool IsTenantIdentity(ADObjectId id, string partitionFqdn) { if (ADSession.IsBoundToAdam || id.DomainId == null) { return(false); } if (!string.Equals(id.GetPartitionId().ForestFQDN, partitionFqdn, StringComparison.OrdinalIgnoreCase)) { throw new ArgumentException("Object partition FQDN doesn't match partitionFqdn parameter."); } ADObjectId configurationNamingContext = ADSession.GetConfigurationNamingContext(partitionFqdn); if (id.Equals(configurationNamingContext)) { return(false); } ADObjectId domainNamingContext = ADSession.GetDomainNamingContext(partitionFqdn); if (id.Equals(domainNamingContext)) { return(false); } ADObjectId configurationUnitsRoot = ADSession.GetConfigurationUnitsRoot(partitionFqdn); if (id.IsDescendantOf(configurationUnitsRoot)) { return(true); } ADObjectId hostedOrganizationsRoot = ADSession.GetHostedOrganizationsRoot(partitionFqdn); return(id.IsDescendantOf(hostedOrganizationsRoot) && !id.Equals(hostedOrganizationsRoot)); }
internal static ADObjectId GetConfigurationUnitsRootForLocalForest() { return(ADSession.GetConfigurationUnitsRoot(TopologyProvider.LocalForestFqdn)); }