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)); }
// Token: 0x06000354 RID: 852 RVA: 0x00012094 File Offset: 0x00010294 private static ADNotificationRequestCookie RegisterChangeNotification <T>(T dummyObject, ADObjectId baseDN, ADNotificationCallback callback, object context) where T : ADConfigurationObject, new() { if (callback == null) { throw new ArgumentNullException("callback"); } if (baseDN == null || string.IsNullOrEmpty(baseDN.DistinguishedName)) { throw new ArgumentNullException("baseDN"); } string forestFQDN = baseDN.GetPartitionId().ForestFQDN; if (!baseDN.IsDescendantOf(ADSession.GetConfigurationNamingContext(forestFQDN)) && !ADSession.IsTenantIdentity(baseDN, forestFQDN)) { throw new ArgumentException(DirectoryStrings.ExArgumentException("baseDN", baseDN), "baseDN"); } ADNotificationRequest adnotificationRequest = new ADNotificationRequest(typeof(T), dummyObject.MostDerivedObjectClass, baseDN, callback, context); ADNotificationListener.RegisterChangeNotification(adnotificationRequest); return(new ADNotificationRequestCookie(new ADNotificationRequest[] { adnotificationRequest })); }
internal static ADObjectId GetConfigurationUnitsRoot(string partitionFqdn) { ADObjectId adobjectId = ADSession.IsTenantConfigInDomainNC(partitionFqdn) ? ADSession.GetRootDomainNamingContext(partitionFqdn) : ADSession.GetMicrosoftExchangeRoot(ADSession.GetConfigurationNamingContext(partitionFqdn)); return(adobjectId.GetChildId("CN", ADObject.ConfigurationUnits)); }
internal static ADObjectId GetConfigurationNamingContextForLocalForest() { return(ADSession.GetConfigurationNamingContext(TopologyProvider.LocalForestFqdn)); }