示例#1
0
        internal override ADSessionSettings FromExternalDirectoryOrganizationId(Guid externalDirectoryOrganizationId)
        {
            ADObjectId    adobjectId    = new ADObjectId(DalHelper.GetTenantDistinguishedName(externalDirectoryOrganizationId.ToString()), externalDirectoryOrganizationId);
            ADPropertyBag adpropertyBag = new ADPropertyBag();

            adpropertyBag[ADObjectSchema.ConfigurationUnit]      = adobjectId;
            adpropertyBag[ADObjectSchema.OrganizationalUnitRoot] = adobjectId;
            OrganizationId organizationId = (OrganizationId)ADObject.OrganizationIdGetter(adpropertyBag);

            return(ADSessionSettings.SessionSettingsFactory.CreateADSessionSettings(ScopeSet.GetOrgWideDefaultScopeSet(organizationId), adobjectId, organizationId, null, ConfigScopes.TenantLocal, PartitionId.LocalForest));
        }
        internal static object OuOrganizationIdGetter(IPropertyBag propertyBag)
        {
            OrganizationId organizationId = (OrganizationId)ADObject.OrganizationIdGetter(propertyBag);

            if (organizationId.Equals(OrganizationId.ForestWideOrgId))
            {
                ADObjectId adobjectId = ADOrganizationalUnit.ConfigurationUnitLinkGetter(propertyBag);
                if (adobjectId != null)
                {
                    organizationId = new OrganizationId((ADObjectId)propertyBag[ADObjectSchema.Id], adobjectId);
                }
            }
            return(organizationId);
        }