static ADReplicationSiteFactory() { ADReplicationSiteFactory <T> ._structuralObjectFilter = ADOPathUtil.CreateFilterClause(ADOperator.Like, "objectClass", "site"); ADReplicationSiteFactory <T> ._rDNPrefix = "CN"; ADReplicationSiteFactory <T> ._structuralObjectClass = "site"; string[] strArrays = new string[1]; strArrays[0] = "name"; ADReplicationSiteFactory <T> ._identityLdapAttributes = strArrays; IdentityResolverDelegate[] customIdentityResolver = new IdentityResolverDelegate[2]; customIdentityResolver[0] = IdentityResolverMethods.GetCustomIdentityResolver(new IdentityResolverDelegate(IdentityResolverMethods.DistinguishedNameIdentityResolver)); IdentityResolverDelegate[] genericIdentityResolver = new IdentityResolverDelegate[2]; genericIdentityResolver[0] = IdentityResolverMethods.GetGenericIdentityResolver(ADReplicationSiteFactory <T> ._identityLdapAttributes); genericIdentityResolver[1] = new IdentityResolverDelegate(IdentityResolverMethods.GuidSearchFilterIdentityResolver); customIdentityResolver[1] = IdentityResolverMethods.GetAggregatedIdentityResolver(ADOperator.Or, genericIdentityResolver); ADReplicationSiteFactory <T> ._identityResolvers = customIdentityResolver; AttributeConverterEntry[] attributeConverterEntry = new AttributeConverterEntry[4]; attributeConverterEntry[0] = new AttributeConverterEntry("Name", "name", TypeConstants.String, false, TypeAdapterAccess.Read, true, AttributeSet.Default, new ToExtendedFormatDelegate(AttributeConverters.ToExtendedObject), null, new ToSearchFilterDelegate(SearchConverters.ToSearchObjectClientSideFilter)); attributeConverterEntry[1] = new AttributeConverterEntry(ADReplicationSiteFactory <T> .ADReplicationSitePropertyMap.Description.PropertyName, ADReplicationSiteFactory <T> .ADReplicationSitePropertyMap.Description.ADAttribute, TypeConstants.String, true, TypeAdapterAccess.ReadWrite, true, AttributeSet.Default, new ToExtendedFormatDelegate(AttributeConverters.ToExtendedObject), new ToDirectoryFormatDelegate(AttributeConverters.ToDirectoryObject), new ToSearchFilterDelegate(SearchConverters.ToSearchObjectClientSideFilter)); attributeConverterEntry[2] = new AttributeConverterEntry(ADReplicationSiteFactory <T> .ADReplicationSitePropertyMap.Subnet.PropertyName, ADReplicationSiteFactory <T> .ADReplicationSitePropertyMap.Subnet.ADAttribute, TypeConstants.ADReplicationSubnet, true, TypeAdapterAccess.Read, false, AttributeSet.Extended, new ToExtendedFormatDelegate(AttributeConverters.ToExtendedMultivalueObject), null, new ToSearchFilterDelegate(SearchConverters.ToSearchObjectClientSideFilter)); attributeConverterEntry[3] = new AttributeConverterEntry(ADReplicationSiteFactory <T> .ADReplicationSitePropertyMap.ManagedBy.PropertyName, ADReplicationSiteFactory <T> .ADReplicationSitePropertyMap.ManagedBy.ADAttribute, TypeConstants.ADPrincipal, true, TypeAdapterAccess.ReadWrite, true, AttributeSet.Default, new ToExtendedFormatDelegate(AttributeConverters.ToExtendedObject), new ToDirectoryFormatDelegate(ADReplicationSiteFactory <T> .ToDirectoryFromNameToManagedByDN), new ToSearchFilterDelegate(SearchConverters.ToSearchObjectClientSideFilter)); ADReplicationSiteFactory <T> .ADMappingTable = attributeConverterEntry; ADReplicationSiteFactory <T> .ADAMMappingTable = ADReplicationSiteFactory <T> .ADMappingTable; ADFactoryBase <T> .RegisterMappingTable(ADReplicationSiteFactory <T> .ADMappingTable, ADServerType.ADDS); ADFactoryBase <T> .RegisterMappingTable(ADReplicationSiteFactory <T> .ADAMMappingTable, ADServerType.ADLDS); }
static ADPrincipalFactory() { ADPrincipalFactory <T> ._principalStructuralFilter = null; string[] strArrays = new string[1]; strArrays[0] = "sAMAccountName"; ADPrincipalFactory <T> ._principalIdentityLdapAttributes = strArrays; IdentityResolverDelegate[] customIdentityResolver = new IdentityResolverDelegate[5]; customIdentityResolver[0] = IdentityResolverMethods.GetCustomIdentityResolver(new IdentityResolverDelegate(IdentityResolverMethods.DistinguishedNameIdentityResolver)); customIdentityResolver[1] = IdentityResolverMethods.GetCustomIdentityResolver(new IdentityResolverDelegate(IdentityResolverMethods.GuidIdentityResolver)); customIdentityResolver[2] = IdentityResolverMethods.GetCustomIdentityResolver(new IdentityResolverDelegate(IdentityResolverMethods.SidIdentityResolver)); customIdentityResolver[3] = IdentityResolverMethods.GetCustomIdentityResolver(new IdentityResolverDelegate(IdentityResolverMethods.SamAccountNameIdentityResolver)); customIdentityResolver[4] = IdentityResolverMethods.GetGenericIdentityResolver(ADPrincipalFactory <T> ._principalIdentityLdapAttributes); ADPrincipalFactory <T> ._identityResolvers = customIdentityResolver; AttributeConverterEntry[] attributeConverterEntry = new AttributeConverterEntry[5]; attributeConverterEntry[0] = new AttributeConverterEntry(ADPrincipalFactory <T> .ADPrincipalPropertyMap.SamAccountName.PropertyName, ADPrincipalFactory <T> .ADPrincipalPropertyMap.SamAccountName.ADAttribute, TypeConstants.String, false, TypeAdapterAccess.ReadWrite, true, AttributeSet.Default, new ToExtendedFormatDelegate(AttributeConverters.ToExtendedObject), new ToDirectoryFormatDelegate(AttributeConverters.ToDirectoryObject), new ToSearchFilterDelegate(SearchConverters.ToSearchUsingSchemaInfo)); attributeConverterEntry[1] = new AttributeConverterEntry(ADPrincipalFactory <T> .ADPrincipalPropertyMap.SID.PropertyName, ADPrincipalFactory <T> .ADPrincipalPropertyMap.SID.ADAttribute, TypeConstants.SID, false, TypeAdapterAccess.Read, true, AttributeSet.Default, new ToExtendedFormatDelegate(AttributeConverters.ToExtendedObject), null, new ToSearchFilterDelegate(SearchConverters.ToSearchUsingSchemaInfo)); attributeConverterEntry[2] = new AttributeConverterEntry(ADPrincipalFactory <T> .ADPrincipalPropertyMap.HomePage.PropertyName, ADPrincipalFactory <T> .ADPrincipalPropertyMap.HomePage.ADAttribute, TypeConstants.String, true, TypeAdapterAccess.ReadWrite, true, AttributeSet.Extended, new ToExtendedFormatDelegate(AttributeConverters.ToExtendedObject), new ToDirectoryFormatDelegate(AttributeConverters.ToDirectoryObject), new ToSearchFilterDelegate(SearchConverters.ToSearchUsingSchemaInfo)); attributeConverterEntry[3] = new AttributeConverterEntry(ADPrincipalFactory <T> .ADPrincipalPropertyMap.SIDHistory.PropertyName, ADPrincipalFactory <T> .ADPrincipalPropertyMap.SIDHistory.ADAttribute, TypeConstants.SID, false, TypeAdapterAccess.Read, false, AttributeSet.Extended, new ToExtendedFormatDelegate(AttributeConverters.ToExtendedMultivalueObject), null, new ToSearchFilterDelegate(SearchConverters.ToSearchUsingSchemaInfo)); attributeConverterEntry[4] = new AttributeConverterEntry(ADPrincipalFactory <T> .ADPrincipalPropertyMap.MemberOf.PropertyName, ADPrincipalFactory <T> .ADPrincipalPropertyMap.MemberOf.ADAttribute, TypeConstants.ADGroup, false, TypeAdapterAccess.Read, false, AttributeSet.Extended, new ToExtendedFormatDelegate(AttributeConverters.ToExtendedMultivalueObject), null, new ToSearchFilterDelegate(SearchConverters.ToSearchUsingSchemaInfo)); ADPrincipalFactory <T> .ADMappingTable = attributeConverterEntry; AttributeConverterEntry[] attributeConverterEntryArray = new AttributeConverterEntry[3]; attributeConverterEntryArray[0] = new AttributeConverterEntry(ADPrincipalFactory <T> .ADPrincipalPropertyMap.SID.PropertyName, ADPrincipalFactory <T> .ADPrincipalPropertyMap.SID.ADAMAttribute, TypeConstants.SID, false, TypeAdapterAccess.Read, true, AttributeSet.Default, new ToExtendedFormatDelegate(AttributeConverters.ToExtendedObject), null, new ToSearchFilterDelegate(SearchConverters.ToSearchUsingSchemaInfo)); attributeConverterEntryArray[1] = new AttributeConverterEntry(ADPrincipalFactory <T> .ADPrincipalPropertyMap.HomePage.PropertyName, ADPrincipalFactory <T> .ADPrincipalPropertyMap.HomePage.ADAMAttribute, TypeConstants.String, true, TypeAdapterAccess.ReadWrite, true, AttributeSet.Extended, new ToExtendedFormatDelegate(AttributeConverters.ToExtendedObject), new ToDirectoryFormatDelegate(AttributeConverters.ToDirectoryObject), new ToSearchFilterDelegate(SearchConverters.ToSearchUsingSchemaInfo)); attributeConverterEntryArray[2] = new AttributeConverterEntry(ADPrincipalFactory <T> .ADPrincipalPropertyMap.MemberOf.PropertyName, ADPrincipalFactory <T> .ADPrincipalPropertyMap.MemberOf.ADAMAttribute, TypeConstants.ADGroup, false, TypeAdapterAccess.Read, false, AttributeSet.Extended, new ToExtendedFormatDelegate(AttributeConverters.ToExtendedMultivalueObject), null, new ToSearchFilterDelegate(SearchConverters.ToSearchUsingSchemaInfo)); ADPrincipalFactory <T> .ADAMMappingTable = attributeConverterEntryArray; IADOPathNode[] aDOPathNodeArray = new IADOPathNode[2]; aDOPathNodeArray[0] = ADOPathUtil.CreateFilterClause(ADOperator.Eq, "objectClass", "group"); aDOPathNodeArray[1] = ADOPathUtil.CreateFilterClause(ADOperator.Eq, "objectClass", "user"); ADPrincipalFactory <T> ._principalStructuralFilter = ADOPathUtil.CreateOrClause(aDOPathNodeArray); ADFactoryBase <T> .RegisterMappingTable(ADPrincipalFactory <T> .ADAMMappingTable, ADServerType.ADLDS); ADFactoryBase <T> .RegisterMappingTable(ADPrincipalFactory <T> .ADMappingTable, ADServerType.ADDS); }
static ADServiceAccountFactory() { IADOPathNode[] aDOPathNodeArray = new IADOPathNode[2]; IADOPathNode[] aDOPathNodeArray1 = new IADOPathNode[2]; aDOPathNodeArray1[0] = ADOPathUtil.CreateFilterClause(ADOperator.Eq, "objectClass", "msDS-ManagedServiceAccount"); aDOPathNodeArray1[1] = ADOPathUtil.CreateFilterClause(ADOperator.Eq, "objectCategory", "msDS-ManagedServiceAccount"); aDOPathNodeArray[0] = ADOPathUtil.CreateAndClause(aDOPathNodeArray1); aDOPathNodeArray[1] = ADOPathUtil.CreateFilterClause(ADOperator.Eq, "objectClass", "msDS-GroupManagedServiceAccount"); ADServiceAccountFactory <T> ._structuralObjectFilter = ADOPathUtil.CreateOrClause(aDOPathNodeArray); string[] strArrays = new string[1]; strArrays[0] = "sAMAccountName"; ADServiceAccountFactory <T> ._serviceAccountIdentityLdapAttributes = strArrays; IdentityResolverDelegate[] customIdentityResolver = new IdentityResolverDelegate[5]; customIdentityResolver[0] = IdentityResolverMethods.GetCustomIdentityResolver(new IdentityResolverDelegate(IdentityResolverMethods.DistinguishedNameIdentityResolver)); customIdentityResolver[1] = IdentityResolverMethods.GetCustomIdentityResolver(new IdentityResolverDelegate(IdentityResolverMethods.GuidIdentityResolver)); customIdentityResolver[2] = IdentityResolverMethods.GetCustomIdentityResolver(new IdentityResolverDelegate(IdentityResolverMethods.SidIdentityResolver)); customIdentityResolver[3] = IdentityResolverMethods.GetCustomIdentityResolver(new IdentityResolverDelegate(IdentityResolverMethods.SamAccountNameIdentityResolver)); customIdentityResolver[4] = ADComputerUtil.GetGenericIdentityResolverWithSamName(ADServiceAccountFactory <T> ._serviceAccountIdentityLdapAttributes); ADServiceAccountFactory <T> ._identityResolvers = customIdentityResolver; AttributeConverterEntry[] attributeConverterEntry = new AttributeConverterEntry[5]; attributeConverterEntry[0] = new AttributeConverterEntry(ADPrincipalFactory <T> .ADPrincipalPropertyMap.SamAccountName.PropertyName, ADPrincipalFactory <T> .ADPrincipalPropertyMap.SamAccountName.ADAttribute, TypeConstants.String, false, TypeAdapterAccess.ReadWrite, true, AttributeSet.Default, new ToExtendedFormatDelegate(AttributeConverters.ToExtendedObject), new ToDirectoryFormatDelegate(ADComputerUtil.ToDirectoryServiceAccountSamAccountName), new ToSearchFilterDelegate(ADComputerUtil.ToSearchComputerSamAccountName)); attributeConverterEntry[1] = new AttributeConverterEntry(ADServiceAccountFactory <T> .ADServiceAccountPropertyMap.HostComputers.PropertyName, ADServiceAccountFactory <T> .ADServiceAccountPropertyMap.HostComputers.ADAttribute, TypeConstants.String, true, TypeAdapterAccess.Read, false, AttributeSet.Extended, new ToExtendedFormatDelegate(AttributeConverters.ToExtendedMultivalueObject), new ToDirectoryFormatDelegate(AttributeConverters.ToDirectoryMultivalueObject), new ToSearchFilterDelegate(SearchConverters.ToSearchUsingSchemaInfo)); attributeConverterEntry[2] = new AttributeConverterEntry(ADServiceAccountFactory <T> .ADServiceAccountPropertyMap.DNSHostName.PropertyName, ADServiceAccountFactory <T> .ADServiceAccountPropertyMap.DNSHostName.ADAttribute, TypeConstants.String, true, TypeAdapterAccess.ReadWrite, true, AttributeSet.Extended, new ToExtendedFormatDelegate(AttributeConverters.ToExtendedObject), new ToDirectoryFormatDelegate(AttributeConverters.ToDirectoryObject), new ToSearchFilterDelegate(SearchConverters.ToSearchUsingSchemaInfo)); attributeConverterEntry[3] = new AttributeConverterEntry(ADServiceAccountFactory <T> .ADServiceAccountPropertyMap.PrincipalsAllowedToRetrieveManagedPassword.PropertyName, ADServiceAccountFactory <T> .ADServiceAccountPropertyMap.PrincipalsAllowedToRetrieveManagedPassword.ADAttribute, TypeConstants.ADPrincipal, true, TypeAdapterAccess.ReadWrite, false, AttributeSet.Extended, new ToExtendedFormatDelegate(AttributeConverters.ToExtendedPrincipalFromSecDesc), new ToDirectoryFormatDelegate(AttributeConverters.ToDirectorySecDescFromPrincipal), new ToSearchFilterDelegate(SearchConverters.ToSearchNotSupported)); attributeConverterEntry[4] = new AttributeConverterEntry(ADServiceAccountFactory <T> .ADServiceAccountPropertyMap.ManagedPasswordIntervalInDays.PropertyName, ADServiceAccountFactory <T> .ADServiceAccountPropertyMap.ManagedPasswordIntervalInDays.ADAttribute, TypeConstants.Int, true, TypeAdapterAccess.ReadWrite, false, AttributeSet.Extended, new ToExtendedFormatDelegate(AttributeConverters.ToExtendedObject), new ToDirectoryFormatDelegate(AttributeConverters.ToDirectoryObject), new ToSearchFilterDelegate(SearchConverters.ToSearchUsingSchemaInfo)); ADServiceAccountFactory <T> .ADMappingTable = attributeConverterEntry; ADFactoryBase <T> .RegisterMappingTable(ADServiceAccountFactory <T> .ADMappingTable, ADServerType.ADDS); ADAccountFactory <T> .DefaultUserAccessControl = 0x1002; ADAccountFactory <T> .UseComputerPasswordGeneration = true; }
static ADObjectFactory() { ADObjectFactory <T> ._structuralObjectFilter = ADOPathUtil.CreateFilterClause(ADOperator.Like, "objectClass", "*"); ADObjectFactory <T> ._rDNPrefix = "CN"; ADObjectFactory <T> ._structuralObjectClass = "top"; ADObjectFactory <T> ._identityLdapAttributes = new string[0]; IdentityResolverDelegate[] customIdentityResolver = new IdentityResolverDelegate[2]; customIdentityResolver[0] = IdentityResolverMethods.GetCustomIdentityResolver(new IdentityResolverDelegate(IdentityResolverMethods.DistinguishedNameIdentityResolver)); customIdentityResolver[1] = IdentityResolverMethods.GetCustomIdentityResolver(new IdentityResolverDelegate(IdentityResolverMethods.GuidIdentityResolver)); ADObjectFactory <T> ._identityResolvers = customIdentityResolver; AttributeConverterEntry[] attributeConverterEntry = new AttributeConverterEntry[14]; attributeConverterEntry[0] = new AttributeConverterEntry(ADObjectFactory <T> .ADObjectPropertyMap.DistinguishedName.PropertyName, ADObjectFactory <T> .ADObjectPropertyMap.DistinguishedName.ADAttribute, TypeConstants.String, false, TypeAdapterAccess.Read, true, AttributeSet.Default, new ToExtendedFormatDelegate(AttributeConverters.ToExtendedObject), null, new ToSearchFilterDelegate(SearchConverters.ToSearchUsingSchemaInfo)); attributeConverterEntry[1] = new AttributeConverterEntry(ADObjectFactory <T> .ADObjectPropertyMap.ObjectClass.PropertyName, ADObjectFactory <T> .ADObjectPropertyMap.ObjectClass.ADAttribute, TypeConstants.String, false, TypeAdapterAccess.Read, true, AttributeSet.Default, new ToExtendedFormatDelegate(AttributeConverters.ToExtendedObject), null, new ToSearchFilterDelegate(SearchConverters.ToSearchUsingSchemaInfo)); attributeConverterEntry[2] = new AttributeConverterEntry(ADObjectFactory <T> .ADObjectPropertyMap.CanonicalName.PropertyName, ADObjectFactory <T> .ADObjectPropertyMap.CanonicalName.ADAttribute, TypeConstants.String, false, TypeAdapterAccess.Read, true, AttributeSet.Extended, new ToExtendedFormatDelegate(AttributeConverters.ToExtendedObject), null, new ToSearchFilterDelegate(SearchConverters.ToSearchUsingSchemaInfo)); attributeConverterEntry[3] = new AttributeConverterEntry(ADObjectFactory <T> .ADObjectPropertyMap.GUID.PropertyName, ADObjectFactory <T> .ADObjectPropertyMap.GUID.ADAttribute, TypeConstants.Guid, false, TypeAdapterAccess.Read, true, AttributeSet.Default, new ToExtendedFormatDelegate(AttributeConverters.ToExtendedObject), null, new ToSearchFilterDelegate(SearchConverters.ToSearchGuid)); attributeConverterEntry[4] = new AttributeConverterEntry(ADObjectFactory <T> .ADObjectPropertyMap.CN.PropertyName, ADObjectFactory <T> .ADObjectPropertyMap.CN.ADAttribute, TypeConstants.String, false, TypeAdapterAccess.Read, true, AttributeSet.Extended, new ToExtendedFormatDelegate(AttributeConverters.ToExtendedObject), new ToDirectoryFormatDelegate(AttributeConverters.ToDirectoryObject), new ToSearchFilterDelegate(SearchConverters.ToSearchUsingSchemaInfo)); attributeConverterEntry[5] = new AttributeConverterEntry(ADObjectFactory <T> .ADObjectPropertyMap.CreationTimeStamp.PropertyName, ADObjectFactory <T> .ADObjectPropertyMap.CreationTimeStamp.ADAttribute, TypeConstants.DateTime, false, TypeAdapterAccess.Read, true, AttributeSet.Extended, new ToExtendedFormatDelegate(AttributeConverters.ToExtendedDateTimeFromDateTime), null, new ToSearchFilterDelegate(SearchConverters.ToSearchDateTimeUsingSchemaInfo)); attributeConverterEntry[6] = new AttributeConverterEntry(ADObjectFactory <T> .ADObjectPropertyMap.Description.PropertyName, ADObjectFactory <T> .ADObjectPropertyMap.Description.ADAttribute, TypeConstants.String, true, TypeAdapterAccess.ReadWrite, true, AttributeSet.Extended, new ToExtendedFormatDelegate(AttributeConverters.ToExtendedObject), new ToDirectoryFormatDelegate(AttributeConverters.ToDirectoryObject), new ToSearchFilterDelegate(SearchConverters.ToSearchUsingSchemaInfo)); attributeConverterEntry[7] = new AttributeConverterEntry(ADObjectFactory <T> .ADObjectPropertyMap.DisplayName.PropertyName, ADObjectFactory <T> .ADObjectPropertyMap.DisplayName.ADAttribute, TypeConstants.String, true, TypeAdapterAccess.ReadWrite, true, AttributeSet.Extended, new ToExtendedFormatDelegate(AttributeConverters.ToExtendedObject), new ToDirectoryFormatDelegate(AttributeConverters.ToDirectoryObject), new ToSearchFilterDelegate(SearchConverters.ToSearchUsingSchemaInfo)); attributeConverterEntry[8] = new AttributeConverterEntry(ADObjectFactory <T> .ADObjectPropertyMap.IsDeleted.PropertyName, ADObjectFactory <T> .ADObjectPropertyMap.IsDeleted.ADAttribute, TypeConstants.Bool, false, TypeAdapterAccess.Read, true, AttributeSet.Extended, new ToExtendedFormatDelegate(AttributeConverters.ToExtendedObject), null, new ToSearchFilterDelegate(SearchConverters.ToSearchUsingSchemaInfo)); attributeConverterEntry[9] = new AttributeConverterEntry(ADObjectFactory <T> .ADObjectPropertyMap.LastKnownParent.PropertyName, ADObjectFactory <T> .ADObjectPropertyMap.LastKnownParent.ADAttribute, TypeConstants.String, false, TypeAdapterAccess.Read, true, AttributeSet.Extended, new ToExtendedFormatDelegate(AttributeConverters.ToExtendedObject), null, new ToSearchFilterDelegate(SearchConverters.ToSearchUsingSchemaInfo)); attributeConverterEntry[10] = new AttributeConverterEntry(ADObjectFactory <T> .ADObjectPropertyMap.ModifiedTimeStamp.PropertyName, ADObjectFactory <T> .ADObjectPropertyMap.ModifiedTimeStamp.ADAttribute, TypeConstants.DateTime, false, TypeAdapterAccess.Read, true, AttributeSet.Extended, new ToExtendedFormatDelegate(AttributeConverters.ToExtendedDateTimeFromDateTime), null, new ToSearchFilterDelegate(SearchConverters.ToSearchDateTimeUsingSchemaInfo)); attributeConverterEntry[11] = new AttributeConverterEntry(ADObjectFactory <T> .ADObjectPropertyMap.ObjectCategory.PropertyName, ADObjectFactory <T> .ADObjectPropertyMap.ObjectCategory.ADAttribute, TypeConstants.String, true, TypeAdapterAccess.Read, true, AttributeSet.Extended, new ToExtendedFormatDelegate(AttributeConverters.ToExtendedObject), null, new ToSearchFilterDelegate(SearchConverters.ToSearchUsingSchemaInfo)); attributeConverterEntry[12] = new AttributeConverterEntry(ADObjectFactory <T> .ADObjectPropertyMap.Name.PropertyName, ADObjectFactory <T> .ADObjectPropertyMap.Name.ADAttribute, TypeConstants.String, false, TypeAdapterAccess.Read, true, AttributeSet.Default, new ToExtendedFormatDelegate(AttributeConverters.ToExtendedObject), null, new ToSearchFilterDelegate(SearchConverters.ToSearchUsingSchemaInfo)); attributeConverterEntry[13] = new AttributeConverterEntry(ADObjectFactory <T> .ADObjectPropertyMap.ProtectedFromDeletion.PropertyName, ADObjectFactory <T> .ADObjectPropertyMap.ProtectedFromDeletion.ADAttribute, TypeConstants.Bool, false, TypeAdapterAccess.ReadWrite, true, AttributeSet.Extended, new ToExtendedFormatDelegate(ADObjectFactory <T> .ToExtendedProtectedFromDeletion), null, new ToSearchFilterDelegate(SearchConverters.ToSearchNotSupported)); ADObjectFactory <T> .ADMappingTable = attributeConverterEntry; ADObjectFactory <T> .ADAMMappingTable = ADObjectFactory <T> .ADMappingTable; ADFactoryBase <T> .RegisterMappingTable(ADObjectFactory <T> .ADAMMappingTable, ADServerType.ADLDS); ADFactoryBase <T> .RegisterMappingTable(ADObjectFactory <T> .ADMappingTable, ADServerType.ADDS); }
static ADReplicationConnectionFactory() { ADReplicationConnectionFactory <T> ._rDNPrefix = "CN"; string[] strArrays = new string[1]; strArrays[0] = "name"; ADReplicationConnectionFactory <T> ._identityLdapAttributes = strArrays; IdentityResolverDelegate[] customIdentityResolver = new IdentityResolverDelegate[2]; customIdentityResolver[0] = IdentityResolverMethods.GetCustomIdentityResolver(new IdentityResolverDelegate(IdentityResolverMethods.DistinguishedNameIdentityResolver)); IdentityResolverDelegate[] genericIdentityResolver = new IdentityResolverDelegate[2]; genericIdentityResolver[0] = IdentityResolverMethods.GetGenericIdentityResolver(ADReplicationConnectionFactory <T> ._identityLdapAttributes); genericIdentityResolver[1] = new IdentityResolverDelegate(IdentityResolverMethods.GuidSearchFilterIdentityResolver); customIdentityResolver[1] = IdentityResolverMethods.GetAggregatedIdentityResolver(ADOperator.Or, genericIdentityResolver); ADReplicationConnectionFactory <T> ._identityResolvers = customIdentityResolver; AttributeConverterEntry[] attributeConverterEntry = new AttributeConverterEntry[6]; attributeConverterEntry[0] = new AttributeConverterEntry("Name", "name", TypeConstants.String, false, TypeAdapterAccess.Read, true, AttributeSet.Default, new ToExtendedFormatDelegate(AttributeConverters.ToExtendedObject), null, new ToSearchFilterDelegate(SearchConverters.ToSearchObjectClientSideFilter)); attributeConverterEntry[1] = new AttributeConverterEntry(ADReplicationConnectionFactory <T> .ADReplicationConnectionPropertyMap.InterSiteTransportProtocol.PropertyName, ADReplicationConnectionFactory <T> .ADReplicationConnectionPropertyMap.InterSiteTransportProtocol.ADAttribute, TypeConstants.String, true, TypeAdapterAccess.Read, true, AttributeSet.Default, new ToExtendedFormatDelegate(ADReplicationConnectionFactory <T> .ToExtendedFromTransportTypeToISTPEnum), null, new ToSearchFilterDelegate(SearchConverters.ToSearchObjectClientSideFilter)); attributeConverterEntry[2] = new AttributeConverterEntry(ADReplicationConnectionFactory <T> .ADReplicationConnectionPropertyMap.ReplicateFromDirectoryServer.PropertyName, ADReplicationConnectionFactory <T> .ADReplicationConnectionPropertyMap.ReplicateFromDirectoryServer.ADAttribute, TypeConstants.ADDirectoryServer, true, TypeAdapterAccess.ReadWrite, true, AttributeSet.Default, new ToExtendedFormatDelegate(AttributeConverters.ToExtendedObject), new ToDirectoryFormatDelegate(ADTopologyUtil.ToDirectoryFromServerNameToNTDSSettings), new ToSearchFilterDelegate(SearchConverters.ToSearchObjectClientSideFilter)); attributeConverterEntry[3] = new AttributeConverterEntry(ADReplicationConnectionFactory <T> .ADReplicationConnectionPropertyMap.ReplicateToDirectoryServer.PropertyName, ADReplicationConnectionFactory <T> .ADReplicationConnectionPropertyMap.ReplicateToDirectoryServer.ADAttribute, TypeConstants.ADDirectoryServer, true, TypeAdapterAccess.Read, true, AttributeSet.Default, new ToExtendedFormatDelegate(ADReplicationConnectionFactory <T> .ToExtendedFromDNToDirectoryServerDN), null, new ToSearchFilterDelegate(SearchConverters.ToSearchObjectClientSideFilter)); attributeConverterEntry[4] = new AttributeConverterEntry(ADReplicationConnectionFactory <T> .ADReplicationConnectionPropertyMap.ReplicationSchedule.PropertyName, ADReplicationConnectionFactory <T> .ADReplicationConnectionPropertyMap.ReplicationSchedule.ADAttribute, TypeConstants.ByteArray, true, TypeAdapterAccess.ReadWrite, true, AttributeSet.Default, new ToExtendedFormatDelegate(AttributeConverters.ToExtendedADReplicationScheduleFromBlob), new ToDirectoryFormatDelegate(AttributeConverters.ToDirectoryBlobFromADReplicationSchedule), new ToSearchFilterDelegate(SearchConverters.ToSearchNotSupported)); attributeConverterEntry[5] = new AttributeConverterEntry(ADReplicationConnectionFactory <T> .ADReplicationConnectionPropertyMap.AutoGenerated.PropertyName, ADReplicationConnectionFactory <T> .ADReplicationConnectionPropertyMap.AutoGenerated.ADAttribute, TypeConstants.Bool, true, TypeAdapterAccess.Read, true, AttributeSet.Default, new ToExtendedFormatDelegate(AttributeConverters.GetDelegateToExtendedFlagFromInt(1, false).Invoke), null, new ToSearchFilterDelegate(SearchConverters.ToSearchObjectClientSideFilter)); ADReplicationConnectionFactory <T> .ADMappingTable = attributeConverterEntry; ADReplicationConnectionFactory <T> .ADAMMappingTable = ADReplicationConnectionFactory <T> .ADMappingTable; ADFactoryBase <T> .RegisterMappingTable(ADReplicationConnectionFactory <T> .ADMappingTable, ADServerType.ADDS); ADFactoryBase <T> .RegisterMappingTable(ADReplicationConnectionFactory <T> .ADAMMappingTable, ADServerType.ADLDS); }
static ADFineGrainedPasswordPolicyFactory() { ADFineGrainedPasswordPolicyFactory <T> ._fgppStructuralFilter = null; string[] strArrays = new string[2]; strArrays[0] = "name"; strArrays[1] = "distinguishedName"; ADFineGrainedPasswordPolicyFactory <T> ._fgppIdentityLdapAttributes = strArrays; IdentityResolverDelegate[] aggregatedIdentityResolver = new IdentityResolverDelegate[1]; IdentityResolverDelegate[] genericIdentityResolver = new IdentityResolverDelegate[2]; genericIdentityResolver[0] = IdentityResolverMethods.GetGenericIdentityResolver(ADFineGrainedPasswordPolicyFactory <T> ._fgppIdentityLdapAttributes); genericIdentityResolver[1] = new IdentityResolverDelegate(IdentityResolverMethods.GuidSearchFilterIdentityResolver); aggregatedIdentityResolver[0] = IdentityResolverMethods.GetAggregatedIdentityResolver(ADOperator.Or, genericIdentityResolver); ADFineGrainedPasswordPolicyFactory <T> ._identityResolvers = aggregatedIdentityResolver; AttributeConverterEntry[] attributeConverterEntry = new AttributeConverterEntry[11]; attributeConverterEntry[0] = new AttributeConverterEntry(ADFineGrainedPasswordPolicyFactory <T> .ADFineGrainedPasswordPolicyPropertyMap.LockoutDuration.PropertyName, ADFineGrainedPasswordPolicyFactory <T> .ADFineGrainedPasswordPolicyPropertyMap.LockoutDuration.ADAttribute, TypeConstants.TimeSpan, true, TypeAdapterAccess.ReadWrite, true, AttributeSet.Default, new ToExtendedFormatDelegate(AttributeConverters.ToExtendedNoExpirationTimeSpan), new ToDirectoryFormatDelegate(AttributeConverters.ToDirectoryNegativeTimeSpan), new ToSearchFilterDelegate(SearchConverters.ToSearchNegativeTimeSpan)); attributeConverterEntry[1] = new AttributeConverterEntry(ADFineGrainedPasswordPolicyFactory <T> .ADFineGrainedPasswordPolicyPropertyMap.LockoutObservationWindow.PropertyName, ADFineGrainedPasswordPolicyFactory <T> .ADFineGrainedPasswordPolicyPropertyMap.LockoutObservationWindow.ADAttribute, TypeConstants.TimeSpan, true, TypeAdapterAccess.ReadWrite, true, AttributeSet.Default, new ToExtendedFormatDelegate(AttributeConverters.ToExtendedNoExpirationTimeSpan), new ToDirectoryFormatDelegate(AttributeConverters.ToDirectoryNegativeTimeSpan), new ToSearchFilterDelegate(SearchConverters.ToSearchNegativeTimeSpan)); attributeConverterEntry[2] = new AttributeConverterEntry(ADFineGrainedPasswordPolicyFactory <T> .ADFineGrainedPasswordPolicyPropertyMap.LockoutThreshold.PropertyName, ADFineGrainedPasswordPolicyFactory <T> .ADFineGrainedPasswordPolicyPropertyMap.LockoutThreshold.ADAttribute, TypeConstants.Int, true, TypeAdapterAccess.ReadWrite, true, AttributeSet.Default, new ToExtendedFormatDelegate(AttributeConverters.ToExtendedObject), new ToDirectoryFormatDelegate(AttributeConverters.ToDirectoryObject), new ToSearchFilterDelegate(SearchConverters.ToSearchUsingSchemaInfo)); attributeConverterEntry[3] = new AttributeConverterEntry(ADFineGrainedPasswordPolicyFactory <T> .ADFineGrainedPasswordPolicyPropertyMap.MaxPasswordAge.PropertyName, ADFineGrainedPasswordPolicyFactory <T> .ADFineGrainedPasswordPolicyPropertyMap.MaxPasswordAge.ADAttribute, TypeConstants.TimeSpan, true, TypeAdapterAccess.ReadWrite, true, AttributeSet.Default, new ToExtendedFormatDelegate(AttributeConverters.ToExtendedNoExpirationTimeSpan), new ToDirectoryFormatDelegate(AttributeConverters.ToDirectoryNoExpirationTimeSpan), new ToSearchFilterDelegate(SearchConverters.ToSearchNegativeTimeSpan)); attributeConverterEntry[4] = new AttributeConverterEntry(ADFineGrainedPasswordPolicyFactory <T> .ADFineGrainedPasswordPolicyPropertyMap.MinPasswordAge.PropertyName, ADFineGrainedPasswordPolicyFactory <T> .ADFineGrainedPasswordPolicyPropertyMap.MinPasswordAge.ADAttribute, TypeConstants.TimeSpan, true, TypeAdapterAccess.ReadWrite, true, AttributeSet.Default, new ToExtendedFormatDelegate(AttributeConverters.ToExtendedNoExpirationTimeSpan), new ToDirectoryFormatDelegate(AttributeConverters.ToDirectoryNegativeTimeSpan), new ToSearchFilterDelegate(SearchConverters.ToSearchNegativeTimeSpan)); attributeConverterEntry[5] = new AttributeConverterEntry(ADFineGrainedPasswordPolicyFactory <T> .ADFineGrainedPasswordPolicyPropertyMap.MinPasswordLength.PropertyName, ADFineGrainedPasswordPolicyFactory <T> .ADFineGrainedPasswordPolicyPropertyMap.MinPasswordLength.ADAttribute, TypeConstants.Int, true, TypeAdapterAccess.ReadWrite, true, AttributeSet.Default, new ToExtendedFormatDelegate(AttributeConverters.ToExtendedObject), new ToDirectoryFormatDelegate(AttributeConverters.ToDirectoryObject), new ToSearchFilterDelegate(SearchConverters.ToSearchUsingSchemaInfo)); attributeConverterEntry[6] = new AttributeConverterEntry(ADFineGrainedPasswordPolicyFactory <T> .ADFineGrainedPasswordPolicyPropertyMap.PasswordHistoryCount.PropertyName, ADFineGrainedPasswordPolicyFactory <T> .ADFineGrainedPasswordPolicyPropertyMap.PasswordHistoryCount.ADAttribute, TypeConstants.Int, true, TypeAdapterAccess.ReadWrite, true, AttributeSet.Default, new ToExtendedFormatDelegate(AttributeConverters.ToExtendedObject), new ToDirectoryFormatDelegate(AttributeConverters.ToDirectoryObject), new ToSearchFilterDelegate(SearchConverters.ToSearchUsingSchemaInfo)); attributeConverterEntry[7] = new AttributeConverterEntry(ADFineGrainedPasswordPolicyFactory <T> .ADFineGrainedPasswordPolicyPropertyMap.ComplexityEnabled.PropertyName, ADFineGrainedPasswordPolicyFactory <T> .ADFineGrainedPasswordPolicyPropertyMap.ComplexityEnabled.ADAttribute, TypeConstants.Bool, true, TypeAdapterAccess.ReadWrite, true, AttributeSet.Default, new ToExtendedFormatDelegate(AttributeConverters.ToExtendedObject), new ToDirectoryFormatDelegate(AttributeConverters.ToDirectoryObject), new ToSearchFilterDelegate(SearchConverters.ToSearchUsingSchemaInfo)); attributeConverterEntry[8] = new AttributeConverterEntry(ADFineGrainedPasswordPolicyFactory <T> .ADFineGrainedPasswordPolicyPropertyMap.ReversibleEncryptionEnabled.PropertyName, ADFineGrainedPasswordPolicyFactory <T> .ADFineGrainedPasswordPolicyPropertyMap.ReversibleEncryptionEnabled.ADAttribute, TypeConstants.Bool, true, TypeAdapterAccess.ReadWrite, true, AttributeSet.Default, new ToExtendedFormatDelegate(AttributeConverters.ToExtendedObject), new ToDirectoryFormatDelegate(AttributeConverters.ToDirectoryObject), new ToSearchFilterDelegate(SearchConverters.ToSearchUsingSchemaInfo)); attributeConverterEntry[9] = new AttributeConverterEntry(ADFineGrainedPasswordPolicyFactory <T> .ADFineGrainedPasswordPolicyPropertyMap.Precedence.PropertyName, ADFineGrainedPasswordPolicyFactory <T> .ADFineGrainedPasswordPolicyPropertyMap.Precedence.ADAttribute, TypeConstants.Int, true, TypeAdapterAccess.ReadWrite, true, AttributeSet.Default, new ToExtendedFormatDelegate(AttributeConverters.ToExtendedObject), new ToDirectoryFormatDelegate(AttributeConverters.ToDirectoryObject), new ToSearchFilterDelegate(SearchConverters.ToSearchUsingSchemaInfo)); attributeConverterEntry[10] = new AttributeConverterEntry(ADFineGrainedPasswordPolicyFactory <T> .ADFineGrainedPasswordPolicyPropertyMap.AppliesTo.PropertyName, ADFineGrainedPasswordPolicyFactory <T> .ADFineGrainedPasswordPolicyPropertyMap.AppliesTo.ADAttribute, TypeConstants.ADPrincipal, true, TypeAdapterAccess.Read, false, AttributeSet.Default, new ToExtendedFormatDelegate(AttributeConverters.ToExtendedMultivalueObject), new ToDirectoryFormatDelegate(AttributeConverters.ToDirectoryMultivalueObject), new ToSearchFilterDelegate(SearchConverters.ToSearchUsingSchemaInfo)); ADFineGrainedPasswordPolicyFactory <T> .ADMappingTable = attributeConverterEntry; ADFineGrainedPasswordPolicyFactory <T> ._fgppStructuralFilter = ADOPathUtil.CreateFilterClause(ADOperator.Eq, "objectClass", "msDS-PasswordSettings"); ADFactoryBase <T> .RegisterMappingTable(ADFineGrainedPasswordPolicyFactory <T> .ADMappingTable, ADServerType.ADDS); }
static ADReplicationSiteLinkFactory() { ADReplicationSiteLinkFactory <T> ._rDNPrefix = "CN"; string[] strArrays = new string[1]; strArrays[0] = "name"; ADReplicationSiteLinkFactory <T> ._identityLdapAttributes = strArrays; IdentityResolverDelegate[] customIdentityResolver = new IdentityResolverDelegate[2]; customIdentityResolver[0] = IdentityResolverMethods.GetCustomIdentityResolver(new IdentityResolverDelegate(IdentityResolverMethods.DistinguishedNameIdentityResolver)); IdentityResolverDelegate[] genericIdentityResolver = new IdentityResolverDelegate[2]; genericIdentityResolver[0] = IdentityResolverMethods.GetGenericIdentityResolver(ADReplicationSiteLinkFactory <T> ._identityLdapAttributes); genericIdentityResolver[1] = new IdentityResolverDelegate(IdentityResolverMethods.GuidSearchFilterIdentityResolver); customIdentityResolver[1] = IdentityResolverMethods.GetAggregatedIdentityResolver(ADOperator.Or, genericIdentityResolver); ADReplicationSiteLinkFactory <T> ._identityResolvers = customIdentityResolver; AttributeConverterEntry[] attributeConverterEntry = new AttributeConverterEntry[5]; attributeConverterEntry[0] = new AttributeConverterEntry(ADReplicationSiteLinkFactory <T> .ADReplicationSiteLinkPropertyMap.ReplicationSchedule.PropertyName, ADReplicationSiteLinkFactory <T> .ADReplicationSiteLinkPropertyMap.ReplicationSchedule.ADAttribute, TypeConstants.ByteArray, true, TypeAdapterAccess.ReadWrite, true, AttributeSet.Extended, new ToExtendedFormatDelegate(AttributeConverters.ToExtendedADReplicationScheduleFromBlob), new ToDirectoryFormatDelegate(AttributeConverters.ToDirectoryBlobFromADReplicationSchedule), new ToSearchFilterDelegate(SearchConverters.ToSearchNotSupported)); attributeConverterEntry[1] = new AttributeConverterEntry(ADReplicationSiteLinkFactory <T> .ADReplicationSiteLinkPropertyMap.ReplicationCost.PropertyName, ADReplicationSiteLinkFactory <T> .ADReplicationSiteLinkPropertyMap.ReplicationCost.ADAttribute, TypeConstants.Int, true, TypeAdapterAccess.ReadWrite, true, AttributeSet.Default, new ToExtendedFormatDelegate(AttributeConverters.ToExtendedObject), new ToDirectoryFormatDelegate(AttributeConverters.ToDirectoryObject), new ToSearchFilterDelegate(SearchConverters.ToSearchUsingSchemaInfo)); attributeConverterEntry[2] = new AttributeConverterEntry(ADReplicationSiteLinkFactory <T> .ADReplicationSiteLinkPropertyMap.ReplicationFrequencyInMinutes.PropertyName, ADReplicationSiteLinkFactory <T> .ADReplicationSiteLinkPropertyMap.ReplicationFrequencyInMinutes.ADAttribute, TypeConstants.Int, true, TypeAdapterAccess.ReadWrite, true, AttributeSet.Default, new ToExtendedFormatDelegate(AttributeConverters.ToExtendedObject), new ToDirectoryFormatDelegate(AttributeConverters.ToDirectoryObject), new ToSearchFilterDelegate(SearchConverters.ToSearchUsingSchemaInfo)); attributeConverterEntry[3] = new AttributeConverterEntry(ADReplicationSiteLinkFactory <T> .ADReplicationSiteLinkPropertyMap.InterSiteTransportProtocol.PropertyName, ADReplicationSiteLinkFactory <T> .ADReplicationSiteLinkPropertyMap.InterSiteTransportProtocol.ADAttribute, typeof(ADInterSiteTransportProtocolType), true, TypeAdapterAccess.ReadWrite, true, AttributeSet.Extended, new ToExtendedFormatDelegate(ADTopologyUtil.ToExtendedFromDNToISTPEnum), null, new ToSearchFilterDelegate(SearchConverters.ToSearchNotSupported)); attributeConverterEntry[4] = new AttributeConverterEntry(ADReplicationSiteLinkFactory <T> .ADReplicationSiteLinkPropertyMap.SitesIncluded.PropertyName, ADReplicationSiteLinkFactory <T> .ADReplicationSiteLinkPropertyMap.SitesIncluded.ADAttribute, TypeConstants.ADReplicationSite, true, TypeAdapterAccess.ReadWrite, false, AttributeSet.Default, new ToExtendedFormatDelegate(AttributeConverters.ToExtendedMultivalueObject), new ToDirectoryFormatDelegate(ADTopologyUtil.ToDirectoryFromTopologyObjectNameListToDNList <ADReplicationSiteFactory <ADReplicationSite>, ADReplicationSite>), new ToSearchFilterDelegate(ADTopologyUtil.ToSearchFromTopologyObjectNameToDN <ADReplicationSiteFactory <ADReplicationSite>, ADReplicationSite>)); ADReplicationSiteLinkFactory <T> .ADMappingTable = attributeConverterEntry; ADReplicationSiteLinkFactory <T> .ADAMMappingTable = ADReplicationSiteLinkFactory <T> .ADMappingTable; ADFactoryBase <T> .RegisterMappingTable(ADReplicationSiteLinkFactory <T> .ADMappingTable, ADServerType.ADDS); ADFactoryBase <T> .RegisterMappingTable(ADReplicationSiteLinkFactory <T> .ADAMMappingTable, ADServerType.ADLDS); }
static ADOptionalFeatureFactory() { ADOptionalFeatureFactory <T> ._ofStructuralFilter = null; string[] strArrays = new string[1]; strArrays[0] = "name"; ADOptionalFeatureFactory <T> ._ofIdentityLdapAttributes = strArrays; IdentityResolverDelegate[] customIdentityResolver = new IdentityResolverDelegate[3]; customIdentityResolver[0] = IdentityResolverMethods.GetCustomIdentityResolver(new IdentityResolverDelegate(IdentityResolverMethods.DistinguishedNameIdentityResolver)); customIdentityResolver[1] = IdentityResolverMethods.GetCustomIdentityResolver(new IdentityResolverDelegate(ADOptionalFeatureFactory <T> .ADOFGuidIdentityResolver)); customIdentityResolver[2] = IdentityResolverMethods.GetGenericIdentityResolver(ADOptionalFeatureFactory <T> ._ofIdentityLdapAttributes); ADOptionalFeatureFactory <T> ._identityResolvers = customIdentityResolver; AttributeConverterEntry[] attributeConverterEntry = new AttributeConverterEntry[6]; attributeConverterEntry[0] = new AttributeConverterEntry(ADOptionalFeatureFactory <T> .ADOptionalFeaturePropertyMap.EnabledScopes.PropertyName, ADOptionalFeatureFactory <T> .ADOptionalFeaturePropertyMap.EnabledScopes.ADAttribute, TypeConstants.String, false, TypeAdapterAccess.Read, false, AttributeSet.Default, new ToExtendedFormatDelegate(AttributeConverters.ToExtendedMultivalueObject), null, new ToSearchFilterDelegate(SearchConverters.ToSearchUsingSchemaInfo)); attributeConverterEntry[1] = new AttributeConverterEntry(ADOptionalFeatureFactory <T> .ADOptionalFeaturePropertyMap.FeatureScope.PropertyName, ADOptionalFeatureFactory <T> .ADOptionalFeaturePropertyMap.FeatureScope.ADAttribute, TypeConstants.Int, false, TypeAdapterAccess.Read, false, AttributeSet.Default, new ToExtendedFormatDelegate(ADOptionalFeatureFactory <T> .ToExtendedFeatureScope), null, new ToSearchFilterDelegate(SearchConverters.ToSearchUsingSchemaInfo)); attributeConverterEntry[2] = new AttributeConverterEntry(ADOptionalFeatureFactory <T> .ADOptionalFeaturePropertyMap.IsDisableable.PropertyName, ADOptionalFeatureFactory <T> .ADOptionalFeaturePropertyMap.IsDisableable.ADAttribute, TypeConstants.Bool, false, TypeAdapterAccess.Read, true, AttributeSet.Default, new ToExtendedFormatDelegate(ADOptionalFeatureFactory <T> .ToExtendedIsDisableable), null, new ToSearchFilterDelegate(SearchConverters.ToSearchUsingSchemaInfo)); attributeConverterEntry[3] = new AttributeConverterEntry(ADOptionalFeatureFactory <T> .ADOptionalFeaturePropertyMap.FeatureGUID.PropertyName, ADOptionalFeatureFactory <T> .ADOptionalFeaturePropertyMap.FeatureGUID.ADAttribute, TypeConstants.Guid, false, TypeAdapterAccess.Read, true, AttributeSet.Default, new ToExtendedFormatDelegate(AttributeConverters.ToExtendedGuid), null, new ToSearchFilterDelegate(SearchConverters.ToSearchGuid)); attributeConverterEntry[4] = new AttributeConverterEntry(ADOptionalFeatureFactory <T> .ADOptionalFeaturePropertyMap.RequiredDomainMode.PropertyName, ADOptionalFeatureFactory <T> .ADOptionalFeaturePropertyMap.RequiredDomainMode.ADAttribute, TypeConstants.ADDomainMode, false, TypeAdapterAccess.Read, true, AttributeSet.Default, new ToExtendedFormatDelegate(AttributeConverters.ToExtendedObjectWithCast <ADDomainMode>), null, new ToSearchFilterDelegate(SearchConverters.ToSearchEnum <ADDomainMode>)); attributeConverterEntry[5] = new AttributeConverterEntry(ADOptionalFeatureFactory <T> .ADOptionalFeaturePropertyMap.RequiredForestMode.PropertyName, ADOptionalFeatureFactory <T> .ADOptionalFeaturePropertyMap.RequiredForestMode.ADAttribute, TypeConstants.ADForestMode, false, TypeAdapterAccess.Read, true, AttributeSet.Default, new ToExtendedFormatDelegate(AttributeConverters.ToExtendedObjectWithCast <ADForestMode>), null, new ToSearchFilterDelegate(SearchConverters.ToSearchEnum <ADForestMode>)); ADOptionalFeatureFactory <T> .ADMappingTable = attributeConverterEntry; ADOptionalFeatureFactory <T> .ADAMMappingTable = ADOptionalFeatureFactory <T> .ADMappingTable; ADOptionalFeatureFactory <T> ._ofStructuralFilter = ADOPathUtil.CreateFilterClause(ADOperator.Eq, "objectClass", "msDS-OptionalFeature"); ADFactoryBase <T> .RegisterMappingTable(ADOptionalFeatureFactory <T> .ADMappingTable, ADServerType.ADDS); ADFactoryBase <T> .RegisterMappingTable(ADOptionalFeatureFactory <T> .ADAMMappingTable, ADServerType.ADLDS); }
static ADClaimTypeFactory() { ADClaimTypeFactory <T> ._rDNPrefix = "CN"; string[] strArrays = new string[2]; strArrays[0] = "name"; strArrays[1] = "displayName"; ADClaimTypeFactory <T> ._identityLdapAttributes = strArrays; IdentityResolverDelegate[] customIdentityResolver = new IdentityResolverDelegate[2]; customIdentityResolver[0] = IdentityResolverMethods.GetCustomIdentityResolver(new IdentityResolverDelegate(IdentityResolverMethods.DistinguishedNameIdentityResolver)); IdentityResolverDelegate[] genericIdentityResolver = new IdentityResolverDelegate[2]; genericIdentityResolver[0] = IdentityResolverMethods.GetGenericIdentityResolver(ADClaimTypeFactory <T> ._identityLdapAttributes); genericIdentityResolver[1] = new IdentityResolverDelegate(IdentityResolverMethods.GuidSearchFilterIdentityResolver); customIdentityResolver[1] = IdentityResolverMethods.GetAggregatedIdentityResolver(ADOperator.Or, genericIdentityResolver); ADClaimTypeFactory <T> ._identityResolvers = customIdentityResolver; string[] strArrays1 = new string[4]; strArrays1[0] = "msDS-ManagedServiceAccount"; strArrays1[1] = "user"; strArrays1[2] = "computer"; strArrays1[3] = "inetOrgPerson"; ADClaimTypeFactory <T> .ValidAppliesToClasses = strArrays1; string[] strArrays2 = new string[4]; strArrays2[0] = "dBCSPwd"; strArrays2[1] = "lmPwdHistory"; strArrays2[2] = "dBCSPwd"; strArrays2[3] = "unicodePwd"; ADClaimTypeFactory <T> .BlockedAttributes = strArrays2; ADClaimTypeFactory <T> .FLAG_ATTR_NOT_REPLICATED = 1; ADClaimTypeFactory <T> .RODCFilteredAttribute = 0x200; string[] strArrays3 = new string[3]; strArrays3[0] = "2.5.5.1"; strArrays3[1] = "2.5.5.12"; strArrays3[2] = "2.5.5.15"; ADClaimTypeFactory <T> .ValidAttributeSyntaxString = strArrays3; string[] strArrays4 = new string[2]; strArrays4[0] = "2.5.5.9"; strArrays4[1] = "2.5.5.16"; ADClaimTypeFactory <T> .ValidAttributeSyntaxInt = strArrays4; ADClaimTypeFactory <T> .ValidAttributeSyntaxUInt = "2.5.5.2"; ADClaimTypeFactory <T> .ValidBooleanAttributeSyntax = "2.5.5.8"; string[] strArrays5 = new string[5]; strArrays5[0] = "lDAPDisplayName"; strArrays5[1] = "systemFlags"; strArrays5[2] = "attributeSyntax"; strArrays5[3] = "isDefunct"; strArrays5[4] = "searchFlags"; ADClaimTypeFactory <T> .SchemaAttributeProperties = strArrays5; AttributeConverterEntry[] attributeConverterEntry = new AttributeConverterEntry[8]; attributeConverterEntry[0] = new AttributeConverterEntry(ADClaimTypeFactory <T> .ADClaimTypePropertyMap.SourceAttribute.PropertyName, ADClaimTypeFactory <T> .ADClaimTypePropertyMap.SourceAttribute.ADAttribute, TypeConstants.String, true, TypeAdapterAccess.ReadWrite, true, AttributeSet.Default, new ToExtendedFormatDelegate(AttributeConverters.ToExtendedObject), new ToDirectoryFormatDelegate(ADClaimTypeFactory <T> .ToDirectoryFromSourceAttributeToDN), new ToSearchFilterDelegate(ADCBACUtil.ToSearchFromSchemaObjectNameToDN)); attributeConverterEntry[1] = new AttributeConverterEntry(ADClaimTypeFactory <T> .ADClaimTypePropertyMap.SourceOID.PropertyName, ADClaimTypeFactory <T> .ADClaimTypePropertyMap.SourceOID.ADAttribute, TypeConstants.String, true, TypeAdapterAccess.ReadWrite, true, AttributeSet.Default, new ToExtendedFormatDelegate(AttributeConverters.ToExtendedObject), new ToDirectoryFormatDelegate(AttributeConverters.ToDirectoryObject), new ToSearchFilterDelegate(SearchConverters.ToSearchUsingSchemaInfo)); attributeConverterEntry[2] = new AttributeConverterEntry(ADClaimTypeFactory <T> .ADClaimTypePropertyMap.AppliesToClasses.PropertyName, ADClaimTypeFactory <T> .ADClaimTypePropertyMap.AppliesToClasses.ADAttribute, TypeConstants.String, true, TypeAdapterAccess.ReadWrite, false, AttributeSet.Default, new ToExtendedFormatDelegate(AttributeConverters.ToExtendedMultivalueObject), new ToDirectoryFormatDelegate(ADCBACUtil.ToDirectoryFromSchemaObjectNameListToDNList), new ToSearchFilterDelegate(ADCBACUtil.ToSearchFromSchemaObjectNameToDN)); attributeConverterEntry[3] = new AttributeConverterEntry(ADClaimTypeFactory <T> .ADClaimTypePropertyMap.RestrictValues.PropertyName, ADClaimTypeFactory <T> .ADClaimTypePropertyMap.RestrictValues.ADAttribute, TypeConstants.Bool, true, TypeAdapterAccess.ReadWrite, true, AttributeSet.Default, new ToExtendedFormatDelegate(AttributeConverters.ToExtendedObject), new ToDirectoryFormatDelegate(AttributeConverters.ToDirectoryObject), new ToSearchFilterDelegate(SearchConverters.ToSearchUsingSchemaInfo)); attributeConverterEntry[4] = new AttributeConverterEntry(ADClaimTypeFactory <T> .ADClaimTypePropertyMap.ValueType.PropertyName, ADClaimTypeFactory <T> .ADClaimTypePropertyMap.ValueType.ADAttribute, TypeConstants.ADClaimValueType, true, TypeAdapterAccess.ReadWrite, true, AttributeSet.Default, new ToExtendedFormatDelegate(ADClaimTypeBaseFactory <ADClaimTypeBase> .ToExtendedFromIntToValueTypeEnum), new ToDirectoryFormatDelegate(AttributeConverters.ToDirectoryObjectWithCast <long>), new ToSearchFilterDelegate(SearchConverters.ToSearchEnum <ADClaimValueType>)); attributeConverterEntry[5] = new AttributeConverterEntry(ADClaimTypeFactory <T> .ADClaimTypePropertyMap.IsSingleValued.PropertyName, ADClaimTypeFactory <T> .ADClaimTypePropertyMap.IsSingleValued.ADAttribute, TypeConstants.Bool, true, TypeAdapterAccess.ReadWrite, true, AttributeSet.Default, new ToExtendedFormatDelegate(AttributeConverters.ToExtendedObject), new ToDirectoryFormatDelegate(AttributeConverters.ToDirectoryObject), new ToSearchFilterDelegate(SearchConverters.ToSearchUsingSchemaInfo)); attributeConverterEntry[6] = new AttributeConverterEntry(ADClaimTypeFactory <T> .ADClaimTypePropertyMap.CompatibleResourceTypes.PropertyName, ADClaimTypeFactory <T> .ADClaimTypePropertyMap.CompatibleResourceTypes.ADAttribute, TypeConstants.ADResourcePropertyValueType, true, TypeAdapterAccess.Read, false, AttributeSet.Default, new ToExtendedFormatDelegate(ADClaimTypeFactory <T> .ToCompatibleResourceTypes), null, new ToSearchFilterDelegate(SearchConverters.ToSearchNotSupported)); attributeConverterEntry[7] = new AttributeConverterEntry(ADClaimTypeFactory <T> .ADClaimTypePropertyMap.ClaimSourceType.PropertyName, ADClaimTypeFactory <T> .ADClaimTypePropertyMap.ClaimSourceType.ADAttribute, TypeConstants.String, true, TypeAdapterAccess.Read, true, AttributeSet.Default, new ToExtendedFormatDelegate(AttributeConverters.ToExtendedObject), null, new ToSearchFilterDelegate(SearchConverters.ToSearchUsingSchemaInfo)); ADClaimTypeFactory <T> .ADMappingTable = attributeConverterEntry; ADFactoryBase <T> .RegisterMappingTable(ADClaimTypeFactory <T> .ADMappingTable, ADServerType.ADDS); }
static ADSchemaObjectFactory() { ADSchemaObjectFactory <T> ._rDNPrefix = "CN"; string[] strArrays = new string[2]; strArrays[0] = "name"; strArrays[1] = "lDAPDisplayName"; ADSchemaObjectFactory <T> ._identityLdapAttributes = strArrays; IdentityResolverDelegate[] customIdentityResolver = new IdentityResolverDelegate[2]; customIdentityResolver[0] = IdentityResolverMethods.GetCustomIdentityResolver(new IdentityResolverDelegate(IdentityResolverMethods.DistinguishedNameIdentityResolver)); IdentityResolverDelegate[] genericIdentityResolver = new IdentityResolverDelegate[2]; genericIdentityResolver[0] = IdentityResolverMethods.GetGenericIdentityResolver(ADSchemaObjectFactory <T> ._identityLdapAttributes); genericIdentityResolver[1] = new IdentityResolverDelegate(IdentityResolverMethods.GuidSearchFilterIdentityResolver); customIdentityResolver[1] = IdentityResolverMethods.GetAggregatedIdentityResolver(ADOperator.Or, genericIdentityResolver); ADSchemaObjectFactory <T> ._identityResolvers = customIdentityResolver; }
static ADResourcePropertyListFactory() { ADResourcePropertyListFactory <T> ._rDNPrefix = "CN"; string[] strArrays = new string[1]; strArrays[0] = "name"; ADResourcePropertyListFactory <T> ._identityLdapAttributes = strArrays; IdentityResolverDelegate[] customIdentityResolver = new IdentityResolverDelegate[2]; customIdentityResolver[0] = IdentityResolverMethods.GetCustomIdentityResolver(new IdentityResolverDelegate(IdentityResolverMethods.DistinguishedNameIdentityResolver)); IdentityResolverDelegate[] genericIdentityResolver = new IdentityResolverDelegate[2]; genericIdentityResolver[0] = IdentityResolverMethods.GetGenericIdentityResolver(ADResourcePropertyListFactory <T> ._identityLdapAttributes); genericIdentityResolver[1] = new IdentityResolverDelegate(IdentityResolverMethods.GuidSearchFilterIdentityResolver); customIdentityResolver[1] = IdentityResolverMethods.GetAggregatedIdentityResolver(ADOperator.Or, genericIdentityResolver); ADResourcePropertyListFactory <T> ._identityResolvers = customIdentityResolver; AttributeConverterEntry[] attributeConverterEntry = new AttributeConverterEntry[1]; attributeConverterEntry[0] = new AttributeConverterEntry(ADResourcePropertyListFactory <T> .ADResourcePropertyListPropertyMap.Members.PropertyName, ADResourcePropertyListFactory <T> .ADResourcePropertyListPropertyMap.Members.ADAttribute, TypeConstants.ADResourceProperty, false, TypeAdapterAccess.Read, false, AttributeSet.Default, new ToExtendedFormatDelegate(AttributeConverters.ToExtendedMultivalueObject), new ToDirectoryFormatDelegate(AttributeConverters.ToDirectoryMultivalueObject), new ToSearchFilterDelegate(ADCBACUtil.ToSearchFromResourcePropertyNameToDN)); ADResourcePropertyListFactory <T> .ADMappingTable = attributeConverterEntry; ADFactoryBase <T> .RegisterMappingTable(ADResourcePropertyListFactory <T> .ADMappingTable, ADServerType.ADDS); }
static ADCentralAccessPolicyFactory() { ADCentralAccessPolicyFactory <T> ._rDNPrefix = "CN"; string[] strArrays = new string[1]; strArrays[0] = "name"; ADCentralAccessPolicyFactory <T> ._identityLdapAttributes = strArrays; IdentityResolverDelegate[] customIdentityResolver = new IdentityResolverDelegate[2]; customIdentityResolver[0] = IdentityResolverMethods.GetCustomIdentityResolver(new IdentityResolverDelegate(IdentityResolverMethods.DistinguishedNameIdentityResolver)); IdentityResolverDelegate[] genericIdentityResolver = new IdentityResolverDelegate[2]; genericIdentityResolver[0] = IdentityResolverMethods.GetGenericIdentityResolver(ADCentralAccessPolicyFactory <T> ._identityLdapAttributes); genericIdentityResolver[1] = new IdentityResolverDelegate(IdentityResolverMethods.GuidSearchFilterIdentityResolver); customIdentityResolver[1] = IdentityResolverMethods.GetAggregatedIdentityResolver(ADOperator.Or, genericIdentityResolver); ADCentralAccessPolicyFactory <T> ._identityResolvers = customIdentityResolver; AttributeConverterEntry[] attributeConverterEntry = new AttributeConverterEntry[2]; attributeConverterEntry[0] = new AttributeConverterEntry(ADCentralAccessPolicyFactory <T> .ADCentralAccessPolicyPropertyMap.Members.PropertyName, ADCentralAccessPolicyFactory <T> .ADCentralAccessPolicyPropertyMap.Members.ADAttribute, TypeConstants.ADCentralAccessRule, false, TypeAdapterAccess.Read, false, AttributeSet.Default, new ToExtendedFormatDelegate(AttributeConverters.ToExtendedMultivalueObject), new ToDirectoryFormatDelegate(ADCentralAccessPolicyFactory <ADCentralAccessPolicy> .ToDirectoryCapMember), new ToSearchFilterDelegate(SearchConverters.ToSearchUsingSchemaInfo)); attributeConverterEntry[1] = new AttributeConverterEntry(ADCentralAccessPolicyFactory <T> .ADCentralAccessPolicyPropertyMap.PolicyID.PropertyName, ADCentralAccessPolicyFactory <T> .ADCentralAccessPolicyPropertyMap.PolicyID.ADAttribute, TypeConstants.SID, false, TypeAdapterAccess.Read, true, AttributeSet.Default, new ToExtendedFormatDelegate(AttributeConverters.ToExtendedObject), null, new ToSearchFilterDelegate(SearchConverters.ToSearchUsingSchemaInfo)); ADCentralAccessPolicyFactory <T> .ADMappingTable = attributeConverterEntry; ADFactoryBase <T> .RegisterMappingTable(ADCentralAccessPolicyFactory <T> .ADMappingTable, ADServerType.ADDS); }
internal static ADObjectSearcher BuildAggregatedSearchFilterIdentityResolver(IdentityResolverDelegate[] identityDelegates, ADOperator op, object identity, string searchRoot, CmdletSessionInfo cmdletSessionInfo, out bool useSearchFilter) { ADObjectSearcher item; List <IADOPathNode> aDOPathNodes = new List <IADOPathNode>((int)identityDelegates.Length); IdentityResolverDelegate[] identityResolverDelegateArray = identityDelegates; for (int i = 0; i < (int)identityResolverDelegateArray.Length; i++) { bool V_1; IdentityResolverDelegate identityResolverDelegate = identityResolverDelegateArray[i]; item = identityResolverDelegate(identity, searchRoot, cmdletSessionInfo, out V_1); if (item != null) { aDOPathNodes.Add(item.Filter); } } item = SearchUtility.BuildSearcher(cmdletSessionInfo.ADSessionInfo, searchRoot, ADSearchScope.Subtree); if (aDOPathNodes.Count <= 1) { if (aDOPathNodes.Count != 1) { item = null; } else { item.Filter = aDOPathNodes[0]; } } else { if (ADOperator.Or != op) { item.Filter = ADOPathUtil.CreateAndClause(aDOPathNodes.ToArray()); } else { item.Filter = ADOPathUtil.CreateOrClause(aDOPathNodes.ToArray()); } } useSearchFilter = true; return(item); }
internal static ADObjectSearcher BuildAggregatedSearchFilterIdentityResolver(IdentityResolverDelegate[] identityDelegates, ADOperator op, object identity, string searchRoot, CmdletSessionInfo cmdletSessionInfo, out bool useSearchFilter) { ADObjectSearcher item; List<IADOPathNode> aDOPathNodes = new List<IADOPathNode>((int)identityDelegates.Length); IdentityResolverDelegate[] identityResolverDelegateArray = identityDelegates; for (int i = 0; i < (int)identityResolverDelegateArray.Length; i++) { bool V_1; IdentityResolverDelegate identityResolverDelegate = identityResolverDelegateArray[i]; item = identityResolverDelegate(identity, searchRoot, cmdletSessionInfo, out V_1); if (item != null) { aDOPathNodes.Add(item.Filter); } } item = SearchUtility.BuildSearcher(cmdletSessionInfo.ADSessionInfo, searchRoot, ADSearchScope.Subtree); if (aDOPathNodes.Count <= 1) { if (aDOPathNodes.Count != 1) { item = null; } else { item.Filter = aDOPathNodes[0]; } } else { if (ADOperator.Or != op) { item.Filter = ADOPathUtil.CreateAndClause(aDOPathNodes.ToArray()); } else { item.Filter = ADOPathUtil.CreateOrClause(aDOPathNodes.ToArray()); } } useSearchFilter = true; return item; }
static ADClaimTransformPolicyFactory() { ADClaimTransformPolicyFactory <T> .RuleXml = " <ClaimsTransformationPolicy> <Rules version=\"1\"> <![CDATA[{0}]]> </Rules></ClaimsTransformationPolicy>"; ADClaimTransformPolicyFactory <T> ._rDNPrefix = "CN"; string[] strArrays = new string[1]; strArrays[0] = "name"; ADClaimTransformPolicyFactory <T> ._identityLdapAttributes = strArrays; IdentityResolverDelegate[] customIdentityResolver = new IdentityResolverDelegate[2]; customIdentityResolver[0] = IdentityResolverMethods.GetCustomIdentityResolver(new IdentityResolverDelegate(IdentityResolverMethods.DistinguishedNameIdentityResolver)); IdentityResolverDelegate[] genericIdentityResolver = new IdentityResolverDelegate[2]; genericIdentityResolver[0] = IdentityResolverMethods.GetGenericIdentityResolver(ADClaimTransformPolicyFactory <T> ._identityLdapAttributes); genericIdentityResolver[1] = new IdentityResolverDelegate(IdentityResolverMethods.GuidSearchFilterIdentityResolver); customIdentityResolver[1] = IdentityResolverMethods.GetAggregatedIdentityResolver(ADOperator.Or, genericIdentityResolver); ADClaimTransformPolicyFactory <T> ._identityResolvers = customIdentityResolver; AttributeConverterEntry[] attributeConverterEntry = new AttributeConverterEntry[3]; attributeConverterEntry[0] = new AttributeConverterEntry(ADClaimTransformPolicyFactory <T> .ADClaimTransformPolicyPropertyMap.IncomingTrust.PropertyName, ADClaimTransformPolicyFactory <T> .ADClaimTransformPolicyPropertyMap.IncomingTrust.ADAttribute, TypeConstants.String, false, TypeAdapterAccess.Read, false, AttributeSet.Default, new ToExtendedFormatDelegate(AttributeConverters.ToExtendedMultivalueObject), null, new ToSearchFilterDelegate(ADCBACUtil.ToSearchFromTrustNameToDN)); attributeConverterEntry[1] = new AttributeConverterEntry(ADClaimTransformPolicyFactory <T> .ADClaimTransformPolicyPropertyMap.OutgoingTrust.PropertyName, ADClaimTransformPolicyFactory <T> .ADClaimTransformPolicyPropertyMap.OutgoingTrust.ADAttribute, TypeConstants.String, false, TypeAdapterAccess.Read, false, AttributeSet.Default, new ToExtendedFormatDelegate(AttributeConverters.ToExtendedMultivalueObject), null, new ToSearchFilterDelegate(ADCBACUtil.ToSearchFromTrustNameToDN)); attributeConverterEntry[2] = new AttributeConverterEntry(ADClaimTransformPolicyFactory <T> .ADClaimTransformPolicyPropertyMap.Rule.PropertyName, ADClaimTransformPolicyFactory <T> .ADClaimTransformPolicyPropertyMap.Rule.ADAttribute, TypeConstants.String, true, TypeAdapterAccess.ReadWrite, true, AttributeSet.Default, new ToExtendedFormatDelegate(ADClaimTransformPolicyFactory <T> .ToPolicyRuleStringFromRuleXml), new ToDirectoryFormatDelegate(ADClaimTransformPolicyFactory <T> .ToRuleXmlFromPolicyString), new ToSearchFilterDelegate(SearchConverters.ToSearchNotSupported)); ADClaimTransformPolicyFactory <T> .ADMappingTable = attributeConverterEntry; ADFactoryBase <T> .RegisterMappingTable(ADClaimTransformPolicyFactory <T> .ADMappingTable, ADServerType.ADDS); }
static ADClaimTypeBaseFactory() { ADClaimTypeBaseFactory <T> ._rDNPrefix = "CN"; string[] strArrays = new string[1]; strArrays[0] = "name"; ADClaimTypeBaseFactory <T> ._identityLdapAttributes = strArrays; IdentityResolverDelegate[] customIdentityResolver = new IdentityResolverDelegate[2]; customIdentityResolver[0] = IdentityResolverMethods.GetCustomIdentityResolver(new IdentityResolverDelegate(IdentityResolverMethods.DistinguishedNameIdentityResolver)); IdentityResolverDelegate[] genericIdentityResolver = new IdentityResolverDelegate[2]; genericIdentityResolver[0] = IdentityResolverMethods.GetGenericIdentityResolver(ADClaimTypeBaseFactory <T> ._identityLdapAttributes); genericIdentityResolver[1] = new IdentityResolverDelegate(IdentityResolverMethods.GuidSearchFilterIdentityResolver); customIdentityResolver[1] = IdentityResolverMethods.GetAggregatedIdentityResolver(ADOperator.Or, genericIdentityResolver); ADClaimTypeBaseFactory <T> ._identityResolvers = customIdentityResolver; AttributeConverterEntry[] attributeConverterEntry = new AttributeConverterEntry[4]; attributeConverterEntry[0] = new AttributeConverterEntry(ADClaimTypeBaseFactory <T> .ADClaimTypeBasePropertyMap.SuggestedValues.PropertyName, ADClaimTypeBaseFactory <T> .ADClaimTypeBasePropertyMap.SuggestedValues.ADAttribute, TypeConstants.ByteArray, true, TypeAdapterAccess.ReadWrite, false, AttributeSet.Default, new ToExtendedFormatDelegate(ADCBACUtil.ToExtendedADSuggestedValueEntryListFromXml), new ToDirectoryFormatDelegate(ADCBACUtil.ToDirectoryXmlFromADSuggestedValueEntryList), new ToSearchFilterDelegate(SearchConverters.ToSearchNotSupported)); attributeConverterEntry[1] = new AttributeConverterEntry(ADClaimTypeBaseFactory <T> .ADClaimTypeBasePropertyMap.ID.PropertyName, ADClaimTypeBaseFactory <T> .ADClaimTypeBasePropertyMap.ID.ADAttribute, TypeConstants.String, false, TypeAdapterAccess.Read, true, AttributeSet.Default, new ToExtendedFormatDelegate(AttributeConverters.ToExtendedObject), null, new ToSearchFilterDelegate(SearchConverters.ToSearchUsingSchemaInfo)); attributeConverterEntry[2] = new AttributeConverterEntry(ADClaimTypeBaseFactory <T> .ADClaimTypeBasePropertyMap.DisplayName.PropertyName, ADClaimTypeBaseFactory <T> .ADClaimTypeBasePropertyMap.DisplayName.ADAttribute, TypeConstants.String, true, TypeAdapterAccess.ReadWrite, true, AttributeSet.Default, new ToExtendedFormatDelegate(AttributeConverters.ToExtendedObject), new ToDirectoryFormatDelegate(AttributeConverters.ToDirectoryObject), new ToSearchFilterDelegate(SearchConverters.ToSearchUsingSchemaInfo)); attributeConverterEntry[3] = new AttributeConverterEntry(ADClaimTypeBaseFactory <T> .ADClaimTypeBasePropertyMap.Enabled.PropertyName, ADClaimTypeBaseFactory <T> .ADClaimTypeBasePropertyMap.Enabled.ADAttribute, TypeConstants.Bool, true, TypeAdapterAccess.ReadWrite, true, AttributeSet.Default, new ToExtendedFormatDelegate(AttributeConverters.ToExtendedObject), new ToDirectoryFormatDelegate(AttributeConverters.ToDirectoryObject), new ToSearchFilterDelegate(SearchConverters.ToSearchUsingSchemaInfo)); ADClaimTypeBaseFactory <T> .ADMappingTable = attributeConverterEntry; ADFactoryBase <T> .RegisterMappingTable(ADClaimTypeBaseFactory <T> .ADMappingTable, ADServerType.ADDS); }
static ADNtdsSettingFactory() { ADNtdsSettingFactory <T> ._rDNPrefix = "CN"; string[] strArrays = new string[1]; strArrays[0] = "name"; ADNtdsSettingFactory <T> ._identityLdapAttributes = strArrays; IdentityResolverDelegate[] customIdentityResolver = new IdentityResolverDelegate[2]; customIdentityResolver[0] = IdentityResolverMethods.GetCustomIdentityResolver(new IdentityResolverDelegate(IdentityResolverMethods.DistinguishedNameIdentityResolver)); IdentityResolverDelegate[] genericIdentityResolver = new IdentityResolverDelegate[2]; genericIdentityResolver[0] = IdentityResolverMethods.GetGenericIdentityResolver(ADNtdsSettingFactory <T> ._identityLdapAttributes); genericIdentityResolver[1] = new IdentityResolverDelegate(IdentityResolverMethods.GuidSearchFilterIdentityResolver); customIdentityResolver[1] = IdentityResolverMethods.GetAggregatedIdentityResolver(ADOperator.Or, genericIdentityResolver); ADNtdsSettingFactory <T> ._identityResolvers = customIdentityResolver; AttributeConverterEntry[] attributeConverterEntry = new AttributeConverterEntry[2]; attributeConverterEntry[0] = new AttributeConverterEntry(ADNtdsSettingFactory <T> .ADNtdsSettingPropertyMap.ReplicatedNamingContexts.PropertyName, ADNtdsSettingFactory <T> .ADNtdsSettingPropertyMap.ReplicatedNamingContexts.ADAttribute, TypeConstants.String, true, TypeAdapterAccess.Read, false, AttributeSet.Default, new ToExtendedFormatDelegate(AttributeConverters.ToExtendedMultivalueStringFromMultiAttribute), null, new ToSearchFilterDelegate(SearchConverters.ToSearchObjectClientSideFilter)); attributeConverterEntry[1] = new AttributeConverterEntry(ADNtdsSettingFactory <T> .ADNtdsSettingPropertyMap.PartiallyReplicatedNamingContexts.PropertyName, ADNtdsSettingFactory <T> .ADNtdsSettingPropertyMap.PartiallyReplicatedNamingContexts.ADAttribute, TypeConstants.String, true, TypeAdapterAccess.Read, false, AttributeSet.Default, new ToExtendedFormatDelegate(AttributeConverters.ToExtendedMultivalueObject), null, new ToSearchFilterDelegate(SearchConverters.ToSearchObjectClientSideFilter)); ADNtdsSettingFactory <T> .ADMappingTable = attributeConverterEntry; ADNtdsSettingFactory <T> .ADAMMappingTable = ADNtdsSettingFactory <T> .ADMappingTable; ADFactoryBase <T> .RegisterMappingTable(ADNtdsSettingFactory <T> .ADMappingTable, ADServerType.ADDS); ADFactoryBase <T> .RegisterMappingTable(ADNtdsSettingFactory <T> .ADAMMappingTable, ADServerType.ADLDS); }
static ADComputerFactory() { IADOPathNode[] aDOPathNodeArray = new IADOPathNode[2]; aDOPathNodeArray[0] = ADOPathUtil.CreateFilterClause(ADOperator.Eq, "objectClass", "computer"); aDOPathNodeArray[1] = ADOPathUtil.CreateFilterClause(ADOperator.Eq, "objectCategory", "computer"); ADComputerFactory <T> ._structuralObjectFilter = ADOPathUtil.CreateAndClause(aDOPathNodeArray); ADComputerFactory <T> ._rDNPrefix = "CN"; ADComputerFactory <T> ._structuralObjectClass = "computer"; string[] strArrays = new string[1]; strArrays[0] = "sAMAccountName"; ADComputerFactory <T> ._computerIdentityLdapAttributes = strArrays; IdentityResolverDelegate[] customIdentityResolver = new IdentityResolverDelegate[5]; customIdentityResolver[0] = IdentityResolverMethods.GetCustomIdentityResolver(new IdentityResolverDelegate(IdentityResolverMethods.DistinguishedNameIdentityResolver)); customIdentityResolver[1] = IdentityResolverMethods.GetCustomIdentityResolver(new IdentityResolverDelegate(IdentityResolverMethods.GuidIdentityResolver)); customIdentityResolver[2] = IdentityResolverMethods.GetCustomIdentityResolver(new IdentityResolverDelegate(IdentityResolverMethods.SidIdentityResolver)); customIdentityResolver[3] = IdentityResolverMethods.GetCustomIdentityResolver(new IdentityResolverDelegate(IdentityResolverMethods.SamAccountNameIdentityResolver)); customIdentityResolver[4] = ADComputerUtil.GetGenericIdentityResolverWithSamName(ADComputerFactory <T> ._computerIdentityLdapAttributes); ADComputerFactory <T> ._identityResolvers = customIdentityResolver; AttributeConverterEntry[] attributeConverterEntry = new AttributeConverterEntry[11]; attributeConverterEntry[0] = new AttributeConverterEntry(ADPrincipalFactory <T> .ADPrincipalPropertyMap.SamAccountName.PropertyName, ADPrincipalFactory <T> .ADPrincipalPropertyMap.SamAccountName.ADAttribute, TypeConstants.String, false, TypeAdapterAccess.ReadWrite, true, AttributeSet.Default, new ToExtendedFormatDelegate(AttributeConverters.ToExtendedObject), new ToDirectoryFormatDelegate(ADComputerUtil.ToDirectoryComputerSamAccountName), new ToSearchFilterDelegate(ADComputerUtil.ToSearchComputerSamAccountName)); attributeConverterEntry[1] = new AttributeConverterEntry(ADComputerFactory <T> .ADComputerPropertyMap.DNSHostName.PropertyName, ADComputerFactory <T> .ADComputerPropertyMap.DNSHostName.ADAttribute, TypeConstants.String, true, TypeAdapterAccess.ReadWrite, true, AttributeSet.Default, new ToExtendedFormatDelegate(AttributeConverters.ToExtendedObject), new ToDirectoryFormatDelegate(AttributeConverters.ToDirectoryObject), new ToSearchFilterDelegate(SearchConverters.ToSearchUsingSchemaInfo)); attributeConverterEntry[2] = new AttributeConverterEntry(ADComputerFactory <T> .ADComputerPropertyMap.ServiceAccount.PropertyName, ADComputerFactory <T> .ADComputerPropertyMap.ServiceAccount.ADAttribute, TypeConstants.String, true, TypeAdapterAccess.ReadWrite, false, AttributeSet.Extended, new ToExtendedFormatDelegate(AttributeConverters.ToExtendedMultivalueObject), new ToDirectoryFormatDelegate(AttributeConverters.ToDirectoryMultivalueObject), new ToSearchFilterDelegate(SearchConverters.ToSearchUsingSchemaInfo)); attributeConverterEntry[3] = new AttributeConverterEntry(ADComputerFactory <T> .ADComputerPropertyMap.IPv4Address.PropertyName, ADComputerFactory <T> .ADComputerPropertyMap.IPv4Address.ADAttribute, TypeConstants.String, false, TypeAdapterAccess.Read, true, AttributeSet.Extended, new ToExtendedFormatDelegate(ADComputerFactory <T> .ToExtendedIPv4), null, new ToSearchFilterDelegate(ADComputerFactory <T> .ToSearchIPv4)); attributeConverterEntry[4] = new AttributeConverterEntry(ADComputerFactory <T> .ADComputerPropertyMap.IPv6Address.PropertyName, ADComputerFactory <T> .ADComputerPropertyMap.IPv6Address.ADAttribute, TypeConstants.String, false, TypeAdapterAccess.Read, true, AttributeSet.Extended, new ToExtendedFormatDelegate(ADComputerFactory <T> .ToExtendedIPv6), null, new ToSearchFilterDelegate(ADComputerFactory <T> .ToSearchIPv6)); attributeConverterEntry[5] = new AttributeConverterEntry(ADComputerFactory <T> .ADComputerPropertyMap.Location.PropertyName, ADComputerFactory <T> .ADComputerPropertyMap.Location.ADAttribute, TypeConstants.String, true, TypeAdapterAccess.ReadWrite, true, AttributeSet.Extended, new ToExtendedFormatDelegate(AttributeConverters.ToExtendedObject), new ToDirectoryFormatDelegate(AttributeConverters.ToDirectoryObject), new ToSearchFilterDelegate(SearchConverters.ToSearchUsingSchemaInfo)); attributeConverterEntry[6] = new AttributeConverterEntry(ADComputerFactory <T> .ADComputerPropertyMap.ManagedBy.PropertyName, ADComputerFactory <T> .ADComputerPropertyMap.ManagedBy.ADAttribute, TypeConstants.ADPrincipal, true, TypeAdapterAccess.ReadWrite, true, AttributeSet.Extended, new ToExtendedFormatDelegate(AttributeConverters.ToExtendedObject), new ToDirectoryFormatDelegate(AttributeConverters.ToDirectoryFromADObjectToDN <ADPrincipalFactory <ADPrincipal>, ADPrincipal>), new ToSearchFilterDelegate(SearchConverters.ToSearchFromADObjectToDN <ADPrincipalFactory <ADPrincipal>, ADPrincipal>)); attributeConverterEntry[7] = new AttributeConverterEntry(ADComputerFactory <T> .ADComputerPropertyMap.OS.PropertyName, ADComputerFactory <T> .ADComputerPropertyMap.OS.ADAttribute, TypeConstants.String, true, TypeAdapterAccess.ReadWrite, true, AttributeSet.Extended, new ToExtendedFormatDelegate(AttributeConverters.ToExtendedObject), new ToDirectoryFormatDelegate(AttributeConverters.ToDirectoryObject), new ToSearchFilterDelegate(SearchConverters.ToSearchUsingSchemaInfo)); attributeConverterEntry[8] = new AttributeConverterEntry(ADComputerFactory <T> .ADComputerPropertyMap.OSHotfix.PropertyName, ADComputerFactory <T> .ADComputerPropertyMap.OSHotfix.ADAttribute, TypeConstants.String, true, TypeAdapterAccess.ReadWrite, true, AttributeSet.Extended, new ToExtendedFormatDelegate(AttributeConverters.ToExtendedObject), new ToDirectoryFormatDelegate(AttributeConverters.ToDirectoryObject), new ToSearchFilterDelegate(SearchConverters.ToSearchUsingSchemaInfo)); attributeConverterEntry[9] = new AttributeConverterEntry(ADComputerFactory <T> .ADComputerPropertyMap.OSServicePack.PropertyName, ADComputerFactory <T> .ADComputerPropertyMap.OSServicePack.ADAttribute, TypeConstants.String, true, TypeAdapterAccess.ReadWrite, true, AttributeSet.Extended, new ToExtendedFormatDelegate(AttributeConverters.ToExtendedObject), new ToDirectoryFormatDelegate(AttributeConverters.ToDirectoryObject), new ToSearchFilterDelegate(SearchConverters.ToSearchUsingSchemaInfo)); attributeConverterEntry[10] = new AttributeConverterEntry(ADComputerFactory <T> .ADComputerPropertyMap.OSVersion.PropertyName, ADComputerFactory <T> .ADComputerPropertyMap.OSVersion.ADAttribute, TypeConstants.String, true, TypeAdapterAccess.ReadWrite, true, AttributeSet.Extended, new ToExtendedFormatDelegate(AttributeConverters.ToExtendedObject), new ToDirectoryFormatDelegate(AttributeConverters.ToDirectoryObject), new ToSearchFilterDelegate(SearchConverters.ToSearchUsingSchemaInfo)); ADComputerFactory <T> .ADMappingTable = attributeConverterEntry; ADComputerFactory <T> .ADAMMappingTable = ADComputerFactory <T> .ADMappingTable; ADFactoryBase <T> .RegisterMappingTable(ADComputerFactory <T> .ADAMMappingTable, ADServerType.ADLDS); ADFactoryBase <T> .RegisterMappingTable(ADComputerFactory <T> .ADMappingTable, ADServerType.ADDS); ADAccountFactory <T> .DefaultUserAccessControl = 0x1002; ADAccountFactory <T> .UseComputerPasswordGeneration = true; }
static ADReplicationSubnetFactory() { ADReplicationSubnetFactory <T> ._rDNPrefix = "CN"; string[] strArrays = new string[1]; strArrays[0] = "name"; ADReplicationSubnetFactory <T> ._identityLdapAttributes = strArrays; IdentityResolverDelegate[] customIdentityResolver = new IdentityResolverDelegate[2]; customIdentityResolver[0] = IdentityResolverMethods.GetCustomIdentityResolver(new IdentityResolverDelegate(IdentityResolverMethods.DistinguishedNameIdentityResolver)); IdentityResolverDelegate[] genericIdentityResolver = new IdentityResolverDelegate[2]; genericIdentityResolver[0] = IdentityResolverMethods.GetGenericIdentityResolver(ADReplicationSubnetFactory <T> ._identityLdapAttributes); genericIdentityResolver[1] = new IdentityResolverDelegate(IdentityResolverMethods.GuidSearchFilterIdentityResolver); customIdentityResolver[1] = IdentityResolverMethods.GetAggregatedIdentityResolver(ADOperator.Or, genericIdentityResolver); ADReplicationSubnetFactory <T> ._identityResolvers = customIdentityResolver; AttributeConverterEntry[] attributeConverterEntry = new AttributeConverterEntry[2]; attributeConverterEntry[0] = new AttributeConverterEntry(ADReplicationSubnetFactory <T> .ADReplicationSubnetPropertyMap.Location.PropertyName, ADReplicationSubnetFactory <T> .ADReplicationSubnetPropertyMap.Location.ADAttribute, TypeConstants.String, true, TypeAdapterAccess.ReadWrite, true, AttributeSet.Default, new ToExtendedFormatDelegate(AttributeConverters.ToExtendedObject), new ToDirectoryFormatDelegate(AttributeConverters.ToDirectoryObject), new ToSearchFilterDelegate(SearchConverters.ToSearchUsingSchemaInfo)); attributeConverterEntry[1] = new AttributeConverterEntry(ADReplicationSubnetFactory <T> .ADReplicationSubnetPropertyMap.Site.PropertyName, ADReplicationSubnetFactory <T> .ADReplicationSubnetPropertyMap.Site.ADAttribute, TypeConstants.ADReplicationSite, true, TypeAdapterAccess.ReadWrite, true, AttributeSet.Default, new ToExtendedFormatDelegate(AttributeConverters.ToExtendedObject), new ToDirectoryFormatDelegate(ADTopologyUtil.ToDirectoryFromSiteNameToDN), new ToSearchFilterDelegate(ADTopologyUtil.ToSearchFromTopologyObjectNameToDN <ADReplicationSiteFactory <ADReplicationSite>, ADReplicationSite>)); ADReplicationSubnetFactory <T> .ADMappingTable = attributeConverterEntry; ADReplicationSubnetFactory <T> .ADAMMappingTable = ADReplicationSubnetFactory <T> .ADMappingTable; ADFactoryBase <T> .RegisterMappingTable(ADReplicationSubnetFactory <T> .ADMappingTable, ADServerType.ADDS); ADFactoryBase <T> .RegisterMappingTable(ADReplicationSubnetFactory <T> .ADAMMappingTable, ADServerType.ADLDS); }
static ADResourcePropertyValueTypeFactory() { ADResourcePropertyValueTypeFactory <T> ._rDNPrefix = "CN"; string[] strArrays = new string[1]; strArrays[0] = "name"; ADResourcePropertyValueTypeFactory <T> ._identityLdapAttributes = strArrays; IdentityResolverDelegate[] customIdentityResolver = new IdentityResolverDelegate[2]; customIdentityResolver[0] = IdentityResolverMethods.GetCustomIdentityResolver(new IdentityResolverDelegate(IdentityResolverMethods.DistinguishedNameIdentityResolver)); IdentityResolverDelegate[] genericIdentityResolver = new IdentityResolverDelegate[2]; genericIdentityResolver[0] = IdentityResolverMethods.GetGenericIdentityResolver(ADResourcePropertyValueTypeFactory <T> ._identityLdapAttributes); genericIdentityResolver[1] = new IdentityResolverDelegate(IdentityResolverMethods.GuidSearchFilterIdentityResolver); customIdentityResolver[1] = IdentityResolverMethods.GetAggregatedIdentityResolver(ADOperator.Or, genericIdentityResolver); ADResourcePropertyValueTypeFactory <T> ._identityResolvers = customIdentityResolver; AttributeConverterEntry[] attributeConverterEntry = new AttributeConverterEntry[5]; attributeConverterEntry[0] = new AttributeConverterEntry(ADResourcePropertyValueTypeFactory <T> .ADResourcePropertyValueTypePropertyMap.RestrictValues.PropertyName, ADResourcePropertyValueTypeFactory <T> .ADResourcePropertyValueTypePropertyMap.RestrictValues.ADAttribute, TypeConstants.Bool, false, TypeAdapterAccess.Read, true, AttributeSet.Default, new ToExtendedFormatDelegate(AttributeConverters.ToExtendedObject), null, new ToSearchFilterDelegate(SearchConverters.ToSearchUsingSchemaInfo)); attributeConverterEntry[1] = new AttributeConverterEntry(ADResourcePropertyValueTypeFactory <T> .ADResourcePropertyValueTypePropertyMap.ValueType.PropertyName, ADResourcePropertyValueTypeFactory <T> .ADResourcePropertyValueTypePropertyMap.ValueType.ADAttribute, TypeConstants.ADClaimValueType, false, TypeAdapterAccess.Read, true, AttributeSet.Default, new ToExtendedFormatDelegate(ADClaimTypeBaseFactory <ADClaimTypeBase> .ToExtendedFromIntToValueTypeEnum), null, new ToSearchFilterDelegate(SearchConverters.ToSearchEnum <ADClaimValueType>)); attributeConverterEntry[2] = new AttributeConverterEntry(ADResourcePropertyValueTypeFactory <T> .ADResourcePropertyValueTypePropertyMap.IsSingleValued.PropertyName, ADResourcePropertyValueTypeFactory <T> .ADResourcePropertyValueTypePropertyMap.IsSingleValued.ADAttribute, TypeConstants.Bool, false, TypeAdapterAccess.Read, true, AttributeSet.Default, new ToExtendedFormatDelegate(AttributeConverters.ToExtendedObject), null, new ToSearchFilterDelegate(SearchConverters.ToSearchUsingSchemaInfo)); attributeConverterEntry[3] = new AttributeConverterEntry(ADResourcePropertyValueTypeFactory <T> .ADResourcePropertyValueTypePropertyMap.IsSuggestedValuesPresent.PropertyName, ADResourcePropertyValueTypeFactory <T> .ADResourcePropertyValueTypePropertyMap.IsSuggestedValuesPresent.ADAttribute, TypeConstants.Bool, false, TypeAdapterAccess.Read, true, AttributeSet.Default, new ToExtendedFormatDelegate(AttributeConverters.ToExtendedObject), null, new ToSearchFilterDelegate(SearchConverters.ToSearchUsingSchemaInfo)); attributeConverterEntry[4] = new AttributeConverterEntry(ADResourcePropertyValueTypeFactory <T> .ADResourcePropertyValueTypePropertyMap.ResourceProperties.PropertyName, ADResourcePropertyValueTypeFactory <T> .ADResourcePropertyValueTypePropertyMap.ResourceProperties.ADAttribute, TypeConstants.ADResourceProperty, false, TypeAdapterAccess.Read, false, AttributeSet.Default, new ToExtendedFormatDelegate(AttributeConverters.ToExtendedMultivalueObject), null, new ToSearchFilterDelegate(ADCBACUtil.ToSearchFromResourcePropertyNameToDN)); ADResourcePropertyValueTypeFactory <T> .ADMappingTable = attributeConverterEntry; ADFactoryBase <T> .RegisterMappingTable(ADResourcePropertyValueTypeFactory <T> .ADMappingTable, ADServerType.ADDS); }
static ADNtdsSiteSettingFactory() { ADNtdsSiteSettingFactory <T> ._structuralObjectFilter = ADOPathUtil.CreateFilterClause(ADOperator.Like, "objectClass", "nTDSSiteSettings"); ADNtdsSiteSettingFactory <T> ._rDNPrefix = "CN"; ADNtdsSiteSettingFactory <T> ._structuralObjectClass = "nTDSSiteSettings"; string[] strArrays = new string[1]; strArrays[0] = "name"; ADNtdsSiteSettingFactory <T> ._identityLdapAttributes = strArrays; IdentityResolverDelegate[] customIdentityResolver = new IdentityResolverDelegate[2]; customIdentityResolver[0] = IdentityResolverMethods.GetCustomIdentityResolver(new IdentityResolverDelegate(IdentityResolverMethods.DistinguishedNameIdentityResolver)); IdentityResolverDelegate[] genericIdentityResolver = new IdentityResolverDelegate[2]; genericIdentityResolver[0] = IdentityResolverMethods.GetGenericIdentityResolver(ADNtdsSiteSettingFactory <T> ._identityLdapAttributes); genericIdentityResolver[1] = new IdentityResolverDelegate(IdentityResolverMethods.GuidSearchFilterIdentityResolver); customIdentityResolver[1] = IdentityResolverMethods.GetAggregatedIdentityResolver(ADOperator.Or, genericIdentityResolver); ADNtdsSiteSettingFactory <T> ._identityResolvers = customIdentityResolver; AttributeConverterEntry[] attributeConverterEntry = new AttributeConverterEntry[16]; attributeConverterEntry[0] = new AttributeConverterEntry(ADNtdsSiteSettingFactory <T> .ADNtdsSiteSettingPropertyMap.InterSiteTopologyGenerator.PropertyName, ADNtdsSiteSettingFactory <T> .ADNtdsSiteSettingPropertyMap.InterSiteTopologyGenerator.ADAttribute, TypeConstants.ADDirectoryServer, true, TypeAdapterAccess.ReadWrite, true, AttributeSet.Default, new ToExtendedFormatDelegate(AttributeConverters.ToExtendedObject), new ToDirectoryFormatDelegate(ADTopologyUtil.ToDirectoryFromServerNameToNTDSSettings), new ToSearchFilterDelegate(SearchConverters.ToSearchObjectClientSideFilter)); attributeConverterEntry[1] = new AttributeConverterEntry(ADNtdsSiteSettingFactory <T> .ADNtdsSiteSettingPropertyMap.ReplicationSchedule.PropertyName, ADNtdsSiteSettingFactory <T> .ADNtdsSiteSettingPropertyMap.ReplicationSchedule.ADAttribute, TypeConstants.ByteArray, true, TypeAdapterAccess.ReadWrite, true, AttributeSet.Default, new ToExtendedFormatDelegate(AttributeConverters.ToExtendedADReplicationScheduleFromBlob), new ToDirectoryFormatDelegate(AttributeConverters.ToDirectoryBlobFromADReplicationSchedule), new ToSearchFilterDelegate(SearchConverters.ToSearchNotSupported)); attributeConverterEntry[2] = new AttributeConverterEntry(ADNtdsSiteSettingFactory <T> .ADNtdsSiteSettingPropertyMap.UniversalGroupCachingRefreshSite.PropertyName, ADNtdsSiteSettingFactory <T> .ADNtdsSiteSettingPropertyMap.UniversalGroupCachingRefreshSite.ADAttribute, TypeConstants.ADReplicationSite, true, TypeAdapterAccess.ReadWrite, true, AttributeSet.Default, new ToExtendedFormatDelegate(AttributeConverters.ToExtendedObject), new ToDirectoryFormatDelegate(ADTopologyUtil.ToDirectoryFromSiteNameToDN), new ToSearchFilterDelegate(SearchConverters.ToSearchObjectClientSideFilter)); attributeConverterEntry[3] = new AttributeConverterEntry(ADNtdsSiteSettingFactory <T> .ADNtdsSiteSettingPropertyMap.AutomaticTopologyGenerationEnabled.PropertyName, ADNtdsSiteSettingFactory <T> .ADNtdsSiteSettingPropertyMap.AutomaticTopologyGenerationEnabled.ADAttribute, TypeConstants.Bool, true, TypeAdapterAccess.ReadWrite, true, AttributeSet.Extended, new ToExtendedFormatDelegate(AttributeConverters.GetDelegateToExtendedFlagFromInt(1, true).Invoke), new ToDirectoryFormatDelegate(AttributeConverters.GetDelegateToDirectoryIntFromFlag(1, true).Invoke), new ToSearchFilterDelegate(SearchConverters.ToSearchObjectClientSideFilter)); attributeConverterEntry[4] = new AttributeConverterEntry(ADNtdsSiteSettingFactory <T> .ADNtdsSiteSettingPropertyMap.TopologyCleanupEnabled.PropertyName, ADNtdsSiteSettingFactory <T> .ADNtdsSiteSettingPropertyMap.TopologyCleanupEnabled.ADAttribute, TypeConstants.Bool, true, TypeAdapterAccess.ReadWrite, true, AttributeSet.Extended, new ToExtendedFormatDelegate(AttributeConverters.GetDelegateToExtendedFlagFromInt(2, true).Invoke), new ToDirectoryFormatDelegate(AttributeConverters.GetDelegateToDirectoryIntFromFlag(2, true).Invoke), new ToSearchFilterDelegate(SearchConverters.ToSearchObjectClientSideFilter)); attributeConverterEntry[5] = new AttributeConverterEntry(ADNtdsSiteSettingFactory <T> .ADNtdsSiteSettingPropertyMap.TopologyMinimumHopsEnabled.PropertyName, ADNtdsSiteSettingFactory <T> .ADNtdsSiteSettingPropertyMap.TopologyMinimumHopsEnabled.ADAttribute, TypeConstants.Bool, true, TypeAdapterAccess.ReadWrite, true, AttributeSet.Extended, new ToExtendedFormatDelegate(AttributeConverters.GetDelegateToExtendedFlagFromInt(4, true).Invoke), new ToDirectoryFormatDelegate(AttributeConverters.GetDelegateToDirectoryIntFromFlag(4, true).Invoke), new ToSearchFilterDelegate(SearchConverters.ToSearchObjectClientSideFilter)); attributeConverterEntry[6] = new AttributeConverterEntry(ADNtdsSiteSettingFactory <T> .ADNtdsSiteSettingPropertyMap.TopologyDetectStaleEnabled.PropertyName, ADNtdsSiteSettingFactory <T> .ADNtdsSiteSettingPropertyMap.TopologyDetectStaleEnabled.ADAttribute, TypeConstants.Bool, true, TypeAdapterAccess.ReadWrite, true, AttributeSet.Extended, new ToExtendedFormatDelegate(AttributeConverters.GetDelegateToExtendedFlagFromInt(8, true).Invoke), new ToDirectoryFormatDelegate(AttributeConverters.GetDelegateToDirectoryIntFromFlag(8, true).Invoke), new ToSearchFilterDelegate(SearchConverters.ToSearchObjectClientSideFilter)); attributeConverterEntry[7] = new AttributeConverterEntry(ADNtdsSiteSettingFactory <T> .ADNtdsSiteSettingPropertyMap.RedundantServerTopologyEnabled.PropertyName, ADNtdsSiteSettingFactory <T> .ADNtdsSiteSettingPropertyMap.RedundantServerTopologyEnabled.ADAttribute, TypeConstants.Bool, true, TypeAdapterAccess.ReadWrite, true, AttributeSet.Extended, new ToExtendedFormatDelegate(AttributeConverters.GetDelegateToExtendedFlagFromInt(0x400, false).Invoke), new ToDirectoryFormatDelegate(AttributeConverters.GetDelegateToDirectoryIntFromFlag(0x400, false).Invoke), new ToSearchFilterDelegate(SearchConverters.ToSearchObjectClientSideFilter)); attributeConverterEntry[8] = new AttributeConverterEntry(ADNtdsSiteSettingFactory <T> .ADNtdsSiteSettingPropertyMap.UniversalGroupCachingEnabled.PropertyName, ADNtdsSiteSettingFactory <T> .ADNtdsSiteSettingPropertyMap.UniversalGroupCachingEnabled.ADAttribute, TypeConstants.Bool, true, TypeAdapterAccess.ReadWrite, true, AttributeSet.Extended, new ToExtendedFormatDelegate(AttributeConverters.GetDelegateToExtendedFlagFromInt(32, false).Invoke), new ToDirectoryFormatDelegate(AttributeConverters.GetDelegateToDirectoryIntFromFlag(32, false).Invoke), new ToSearchFilterDelegate(SearchConverters.ToSearchObjectClientSideFilter)); attributeConverterEntry[9] = new AttributeConverterEntry(ADNtdsSiteSettingFactory <T> .ADNtdsSiteSettingPropertyMap.AutomaticInterSiteTopologyGenerationEnabled.PropertyName, ADNtdsSiteSettingFactory <T> .ADNtdsSiteSettingPropertyMap.AutomaticInterSiteTopologyGenerationEnabled.ADAttribute, TypeConstants.Bool, true, TypeAdapterAccess.ReadWrite, true, AttributeSet.Extended, new ToExtendedFormatDelegate(AttributeConverters.GetDelegateToExtendedFlagFromInt(16, true).Invoke), new ToDirectoryFormatDelegate(AttributeConverters.GetDelegateToDirectoryIntFromFlag(16, true).Invoke), new ToSearchFilterDelegate(SearchConverters.ToSearchObjectClientSideFilter)); attributeConverterEntry[10] = new AttributeConverterEntry(ADNtdsSiteSettingFactory <T> .ADNtdsSiteSettingPropertyMap.WindowsServer2003KCCBehaviorEnabled.PropertyName, ADNtdsSiteSettingFactory <T> .ADNtdsSiteSettingPropertyMap.WindowsServer2003KCCBehaviorEnabled.ADAttribute, TypeConstants.Bool, true, TypeAdapterAccess.ReadWrite, true, AttributeSet.Extended, new ToExtendedFormatDelegate(AttributeConverters.GetDelegateToExtendedFlagFromInt(64, false).Invoke), new ToDirectoryFormatDelegate(AttributeConverters.GetDelegateToDirectoryIntFromFlag(64, false).Invoke), new ToSearchFilterDelegate(SearchConverters.ToSearchObjectClientSideFilter)); attributeConverterEntry[11] = new AttributeConverterEntry(ADNtdsSiteSettingFactory <T> .ADNtdsSiteSettingPropertyMap.WindowsServer2000KCCISTGSelectionBehaviorEnabled.PropertyName, ADNtdsSiteSettingFactory <T> .ADNtdsSiteSettingPropertyMap.WindowsServer2000KCCISTGSelectionBehaviorEnabled.ADAttribute, TypeConstants.Bool, true, TypeAdapterAccess.ReadWrite, true, AttributeSet.Extended, new ToExtendedFormatDelegate(AttributeConverters.GetDelegateToExtendedFlagFromInt(128, false).Invoke), new ToDirectoryFormatDelegate(AttributeConverters.GetDelegateToDirectoryIntFromFlag(128, false).Invoke), new ToSearchFilterDelegate(SearchConverters.ToSearchObjectClientSideFilter)); attributeConverterEntry[12] = new AttributeConverterEntry(ADNtdsSiteSettingFactory <T> .ADNtdsSiteSettingPropertyMap.WindowsServer2000BridgeheadSelectionMethodEnabled.PropertyName, ADNtdsSiteSettingFactory <T> .ADNtdsSiteSettingPropertyMap.WindowsServer2000BridgeheadSelectionMethodEnabled.ADAttribute, TypeConstants.Bool, true, TypeAdapterAccess.ReadWrite, true, AttributeSet.Extended, new ToExtendedFormatDelegate(AttributeConverters.GetDelegateToExtendedFlagFromInt(0x100, true).Invoke), new ToDirectoryFormatDelegate(AttributeConverters.GetDelegateToDirectoryIntFromFlag(0x100, true).Invoke), new ToSearchFilterDelegate(SearchConverters.ToSearchObjectClientSideFilter)); attributeConverterEntry[13] = new AttributeConverterEntry(ADNtdsSiteSettingFactory <T> .ADNtdsSiteSettingPropertyMap.ScheduleHashingEnabled.PropertyName, ADNtdsSiteSettingFactory <T> .ADNtdsSiteSettingPropertyMap.ScheduleHashingEnabled.ADAttribute, TypeConstants.Bool, true, TypeAdapterAccess.ReadWrite, true, AttributeSet.Extended, new ToExtendedFormatDelegate(AttributeConverters.GetDelegateToExtendedFlagFromInt(0x200, false).Invoke), new ToDirectoryFormatDelegate(AttributeConverters.GetDelegateToDirectoryIntFromFlag(0x200, false).Invoke), new ToSearchFilterDelegate(SearchConverters.ToSearchObjectClientSideFilter)); attributeConverterEntry[14] = new AttributeConverterEntry(ADNtdsSiteSettingFactory <T> .ADNtdsSiteSettingPropertyMap.WindowsServer2003KCCIgnoreScheduleEnabled.PropertyName, ADNtdsSiteSettingFactory <T> .ADNtdsSiteSettingPropertyMap.WindowsServer2003KCCIgnoreScheduleEnabled.ADAttribute, TypeConstants.Bool, true, TypeAdapterAccess.ReadWrite, true, AttributeSet.Extended, new ToExtendedFormatDelegate(AttributeConverters.GetDelegateToExtendedFlagFromInt(0x800, false).Invoke), new ToDirectoryFormatDelegate(AttributeConverters.GetDelegateToDirectoryIntFromFlag(0x800, false).Invoke), new ToSearchFilterDelegate(SearchConverters.ToSearchObjectClientSideFilter)); attributeConverterEntry[15] = new AttributeConverterEntry(ADNtdsSiteSettingFactory <T> .ADNtdsSiteSettingPropertyMap.WindowsServer2003KCCSiteLinkBridgingEnabled.PropertyName, ADNtdsSiteSettingFactory <T> .ADNtdsSiteSettingPropertyMap.WindowsServer2003KCCSiteLinkBridgingEnabled.ADAttribute, TypeConstants.Bool, true, TypeAdapterAccess.ReadWrite, true, AttributeSet.Extended, new ToExtendedFormatDelegate(AttributeConverters.GetDelegateToExtendedFlagFromInt(0x1000, false).Invoke), new ToDirectoryFormatDelegate(AttributeConverters.GetDelegateToDirectoryIntFromFlag(0x1000, false).Invoke), new ToSearchFilterDelegate(SearchConverters.ToSearchObjectClientSideFilter)); ADNtdsSiteSettingFactory <T> .ADMappingTable = attributeConverterEntry; ADNtdsSiteSettingFactory <T> .ADAMMappingTable = ADNtdsSiteSettingFactory <T> .ADMappingTable; ADFactoryBase <T> .RegisterMappingTable(ADNtdsSiteSettingFactory <T> .ADMappingTable, ADServerType.ADDS); ADFactoryBase <T> .RegisterMappingTable(ADNtdsSiteSettingFactory <T> .ADAMMappingTable, ADServerType.ADLDS); }
static ADResourcePropertyFactory() { ADResourcePropertyFactory <T> ._rDNPrefix = "CN"; string[] strArrays = new string[2]; strArrays[0] = "name"; strArrays[1] = "displayName"; ADResourcePropertyFactory <T> ._identityLdapAttributes = strArrays; IdentityResolverDelegate[] customIdentityResolver = new IdentityResolverDelegate[2]; customIdentityResolver[0] = IdentityResolverMethods.GetCustomIdentityResolver(new IdentityResolverDelegate(IdentityResolverMethods.DistinguishedNameIdentityResolver)); IdentityResolverDelegate[] genericIdentityResolver = new IdentityResolverDelegate[2]; genericIdentityResolver[0] = IdentityResolverMethods.GetGenericIdentityResolver(ADResourcePropertyFactory <T> ._identityLdapAttributes); genericIdentityResolver[1] = new IdentityResolverDelegate(IdentityResolverMethods.GuidSearchFilterIdentityResolver); customIdentityResolver[1] = IdentityResolverMethods.GetAggregatedIdentityResolver(ADOperator.Or, genericIdentityResolver); ADResourcePropertyFactory <T> ._identityResolvers = customIdentityResolver; AttributeConverterEntry[] attributeConverterEntry = new AttributeConverterEntry[5]; attributeConverterEntry[0] = new AttributeConverterEntry(ADResourcePropertyFactory <T> .ADResourcePropertyPropertyMap.IsSecured.PropertyName, ADResourcePropertyFactory <T> .ADResourcePropertyPropertyMap.IsSecured.ADAttribute, TypeConstants.Bool, true, TypeAdapterAccess.ReadWrite, true, AttributeSet.Default, new ToExtendedFormatDelegate(AttributeConverters.ToExtendedObject), new ToDirectoryFormatDelegate(AttributeConverters.ToDirectoryObject), new ToSearchFilterDelegate(SearchConverters.ToSearchUsingSchemaInfo)); attributeConverterEntry[1] = new AttributeConverterEntry(ADResourcePropertyFactory <T> .ADResourcePropertyPropertyMap.SharesValuesWith.PropertyName, ADResourcePropertyFactory <T> .ADResourcePropertyPropertyMap.SharesValuesWith.ADAttribute, TypeConstants.ADClaimType, true, TypeAdapterAccess.ReadWrite, true, AttributeSet.Default, new ToExtendedFormatDelegate(AttributeConverters.ToExtendedObject), new ToDirectoryFormatDelegate(ADResourcePropertyFactory <T> .ToDirectoryFromSPCTNameToDN), new ToSearchFilterDelegate(ADResourcePropertyFactory <T> .ToSearchFromSPCTNameToDN)); attributeConverterEntry[2] = new AttributeConverterEntry(ADResourcePropertyFactory <T> .ADResourcePropertyPropertyMap.MemberOf.PropertyName, ADResourcePropertyFactory <T> .ADResourcePropertyPropertyMap.MemberOf.ADAttribute, TypeConstants.ADResourcePropertyList, false, TypeAdapterAccess.Read, false, AttributeSet.Default, new ToExtendedFormatDelegate(AttributeConverters.ToExtendedMultivalueObject), null, new ToSearchFilterDelegate(SearchConverters.ToSearchUsingSchemaInfo)); attributeConverterEntry[3] = new AttributeConverterEntry(ADResourcePropertyFactory <T> .ADResourcePropertyPropertyMap.ResourcePropertyValueType.PropertyName, ADResourcePropertyFactory <T> .ADResourcePropertyPropertyMap.ResourcePropertyValueType.ADAttribute, TypeConstants.ADResourcePropertyValueType, true, TypeAdapterAccess.ReadWrite, true, AttributeSet.Default, new ToExtendedFormatDelegate(AttributeConverters.ToExtendedObject), new ToDirectoryFormatDelegate(ADResourcePropertyFactory <T> .ToDirectoryFromResourcePropertyValueTypeNameToDN), new ToSearchFilterDelegate(ADResourcePropertyFactory <T> .ToSearchFromResourcePropertyValueTypeNameToDN)); attributeConverterEntry[4] = new AttributeConverterEntry(ADResourcePropertyFactory <T> .ADResourcePropertyPropertyMap.AppliesToResourceTypes.PropertyName, ADResourcePropertyFactory <T> .ADResourcePropertyPropertyMap.AppliesToResourceTypes.ADAttribute, TypeConstants.String, true, TypeAdapterAccess.ReadWrite, false, AttributeSet.Default, new ToExtendedFormatDelegate(AttributeConverters.ToExtendedMultivalueObject), new ToDirectoryFormatDelegate(AttributeConverters.ToDirectoryMultivalueObject), new ToSearchFilterDelegate(SearchConverters.ToSearchMultivalueObject)); ADResourcePropertyFactory <T> .ADMappingTable = attributeConverterEntry; ADFactoryBase <T> .RegisterMappingTable(ADResourcePropertyFactory <T> .ADMappingTable, ADServerType.ADDS); }
static ADTrustFactory() { ADTrustFactory <T> ._rDNPrefix = "CN"; string[] strArrays = new string[1]; strArrays[0] = "name"; ADTrustFactory <T> ._identityLdapAttributes = strArrays; IdentityResolverDelegate[] customIdentityResolver = new IdentityResolverDelegate[2]; customIdentityResolver[0] = IdentityResolverMethods.GetCustomIdentityResolver(new IdentityResolverDelegate(IdentityResolverMethods.DistinguishedNameIdentityResolver)); IdentityResolverDelegate[] genericIdentityResolver = new IdentityResolverDelegate[2]; genericIdentityResolver[0] = IdentityResolverMethods.GetGenericIdentityResolver(ADTrustFactory <T> ._identityLdapAttributes); genericIdentityResolver[1] = new IdentityResolverDelegate(IdentityResolverMethods.GuidSearchFilterIdentityResolver); customIdentityResolver[1] = IdentityResolverMethods.GetAggregatedIdentityResolver(ADOperator.Or, genericIdentityResolver); ADTrustFactory <T> ._identityResolvers = customIdentityResolver; AttributeConverterEntry[] attributeConverterEntry = new AttributeConverterEntry[19]; attributeConverterEntry[0] = new AttributeConverterEntry(ADTrustFactory <T> .ADTrustPropertyMap.Source.PropertyName, ADTrustFactory <T> .ADTrustPropertyMap.Source.ADAttribute, TypeConstants.String, true, TypeAdapterAccess.Read, true, AttributeSet.Default, new ToExtendedFormatDelegate(ADTrustFactory <T> .ToExtendedSourceNameFromDN), null, new ToSearchFilterDelegate(SearchConverters.ToSearchNotSupported)); attributeConverterEntry[1] = new AttributeConverterEntry(ADTrustFactory <T> .ADTrustPropertyMap.Target.PropertyName, ADTrustFactory <T> .ADTrustPropertyMap.Target.ADAttribute, TypeConstants.String, true, TypeAdapterAccess.Read, true, AttributeSet.Default, new ToExtendedFormatDelegate(AttributeConverters.ToExtendedObject), null, new ToSearchFilterDelegate(SearchConverters.ToSearchUsingSchemaInfo)); attributeConverterEntry[2] = new AttributeConverterEntry(ADTrustFactory <T> .ADTrustPropertyMap.TrustDirection.PropertyName, ADTrustFactory <T> .ADTrustPropertyMap.TrustDirection.ADAttribute, TypeConstants.ADTrustDirection, true, TypeAdapterAccess.Read, true, AttributeSet.Default, new ToExtendedFormatDelegate(AttributeConverters.ToExtendedObjectWithCast <ADTrustDirection>), null, new ToSearchFilterDelegate(SearchConverters.ToSearchEnum <ADTrustDirection>)); attributeConverterEntry[3] = new AttributeConverterEntry(ADTrustFactory <T> .ADTrustPropertyMap.TrustType.PropertyName, ADTrustFactory <T> .ADTrustPropertyMap.TrustType.ADAttribute, TypeConstants.ADTrustType, true, TypeAdapterAccess.Read, true, AttributeSet.Default, new ToExtendedFormatDelegate(AttributeConverters.ToExtendedObjectWithCast <ADTrustType>), null, new ToSearchFilterDelegate(SearchConverters.ToSearchEnum <ADTrustType>)); attributeConverterEntry[4] = new AttributeConverterEntry(ADTrustFactory <T> .ADTrustPropertyMap.TrustAttributes.PropertyName, ADTrustFactory <T> .ADTrustPropertyMap.TrustAttributes.ADAttribute, TypeConstants.Int, true, TypeAdapterAccess.Read, true, AttributeSet.Default, new ToExtendedFormatDelegate(AttributeConverters.ToExtendedObject), null, new ToSearchFilterDelegate(SearchConverters.ToSearchUsingSchemaInfo)); attributeConverterEntry[5] = new AttributeConverterEntry(ADTrustFactory <T> .ADTrustPropertyMap.TrustingPolicy.PropertyName, ADTrustFactory <T> .ADTrustPropertyMap.TrustingPolicy.ADAttribute, TypeConstants.ADClaimTransformPolicy, true, TypeAdapterAccess.ReadWrite, true, AttributeSet.Default, new ToExtendedFormatDelegate(AttributeConverters.ToExtendedObject), new ToDirectoryFormatDelegate(AttributeConverters.ToDirectoryObject), new ToSearchFilterDelegate(ADTrustFactory <T> .ToSearchFromClaimTransformPolicyToDN)); attributeConverterEntry[6] = new AttributeConverterEntry(ADTrustFactory <T> .ADTrustPropertyMap.TrustedPolicy.PropertyName, ADTrustFactory <T> .ADTrustPropertyMap.TrustedPolicy.ADAttribute, TypeConstants.ADClaimTransformPolicy, true, TypeAdapterAccess.ReadWrite, true, AttributeSet.Default, new ToExtendedFormatDelegate(AttributeConverters.ToExtendedObject), new ToDirectoryFormatDelegate(AttributeConverters.ToDirectoryObject), new ToSearchFilterDelegate(ADTrustFactory <T> .ToSearchFromClaimTransformPolicyToDN)); attributeConverterEntry[7] = new AttributeConverterEntry(ADTrustFactory <T> .ADTrustPropertyMap.DisallowTransivity.PropertyName, ADTrustFactory <T> .ADTrustPropertyMap.DisallowTransivity.ADAttribute, TypeConstants.Bool, true, TypeAdapterAccess.Read, true, AttributeSet.Default, new ToExtendedFormatDelegate(AttributeConverters.GetDelegateToExtendedFlagFromInt(1, false).Invoke), null, new ToSearchFilterDelegate(SearchConverters.GetDelegateToSearchFlagInInt(1, false).Invoke)); attributeConverterEntry[8] = new AttributeConverterEntry(ADTrustFactory <T> .ADTrustPropertyMap.UplevelOnly.PropertyName, ADTrustFactory <T> .ADTrustPropertyMap.UplevelOnly.ADAttribute, TypeConstants.Bool, true, TypeAdapterAccess.Read, true, AttributeSet.Default, new ToExtendedFormatDelegate(AttributeConverters.GetDelegateToExtendedFlagFromInt(2, false).Invoke), null, new ToSearchFilterDelegate(SearchConverters.GetDelegateToSearchFlagInInt(2, false).Invoke)); attributeConverterEntry[9] = new AttributeConverterEntry(ADTrustFactory <T> .ADTrustPropertyMap.SIDFilteringQuarantined.PropertyName, ADTrustFactory <T> .ADTrustPropertyMap.SIDFilteringQuarantined.ADAttribute, TypeConstants.Bool, true, TypeAdapterAccess.Read, true, AttributeSet.Default, new ToExtendedFormatDelegate(AttributeConverters.GetDelegateToExtendedFlagFromInt(4, false).Invoke), null, new ToSearchFilterDelegate(SearchConverters.GetDelegateToSearchFlagInInt(4, false).Invoke)); attributeConverterEntry[10] = new AttributeConverterEntry(ADTrustFactory <T> .ADTrustPropertyMap.ForestTransitive.PropertyName, ADTrustFactory <T> .ADTrustPropertyMap.ForestTransitive.ADAttribute, TypeConstants.Bool, true, TypeAdapterAccess.Read, true, AttributeSet.Default, new ToExtendedFormatDelegate(AttributeConverters.GetDelegateToExtendedFlagFromInt(8, false).Invoke), null, new ToSearchFilterDelegate(SearchConverters.GetDelegateToSearchFlagInInt(8, false).Invoke)); attributeConverterEntry[11] = new AttributeConverterEntry(ADTrustFactory <T> .ADTrustPropertyMap.SelectiveAuthentication.PropertyName, ADTrustFactory <T> .ADTrustPropertyMap.SelectiveAuthentication.ADAttribute, TypeConstants.Bool, true, TypeAdapterAccess.Read, true, AttributeSet.Default, new ToExtendedFormatDelegate(AttributeConverters.GetDelegateToExtendedFlagFromInt(16, false).Invoke), null, new ToSearchFilterDelegate(SearchConverters.GetDelegateToSearchFlagInInt(16, false).Invoke)); attributeConverterEntry[12] = new AttributeConverterEntry(ADTrustFactory <T> .ADTrustPropertyMap.IntraForest.PropertyName, ADTrustFactory <T> .ADTrustPropertyMap.IntraForest.ADAttribute, TypeConstants.Bool, true, TypeAdapterAccess.Read, true, AttributeSet.Default, new ToExtendedFormatDelegate(AttributeConverters.GetDelegateToExtendedFlagFromInt(32, false).Invoke), null, new ToSearchFilterDelegate(SearchConverters.GetDelegateToSearchFlagInInt(32, false).Invoke)); attributeConverterEntry[13] = new AttributeConverterEntry(ADTrustFactory <T> .ADTrustPropertyMap.SIDFilteringForestAware.PropertyName, ADTrustFactory <T> .ADTrustPropertyMap.SIDFilteringForestAware.ADAttribute, TypeConstants.Bool, true, TypeAdapterAccess.Read, true, AttributeSet.Default, new ToExtendedFormatDelegate(AttributeConverters.GetDelegateToExtendedFlagFromInt(64, false).Invoke), null, new ToSearchFilterDelegate(SearchConverters.GetDelegateToSearchFlagInInt(64, false).Invoke)); attributeConverterEntry[14] = new AttributeConverterEntry(ADTrustFactory <T> .ADTrustPropertyMap.UsesRC4Encryption.PropertyName, ADTrustFactory <T> .ADTrustPropertyMap.UsesRC4Encryption.ADAttribute, TypeConstants.Bool, true, TypeAdapterAccess.Read, true, AttributeSet.Default, new ToExtendedFormatDelegate(AttributeConverters.GetDelegateToExtendedFlagFromInt(128, false).Invoke), null, new ToSearchFilterDelegate(SearchConverters.GetDelegateToSearchFlagInInt(128, false).Invoke)); attributeConverterEntry[15] = new AttributeConverterEntry(ADTrustFactory <T> .ADTrustPropertyMap.UsesAESKeys.PropertyName, ADTrustFactory <T> .ADTrustPropertyMap.UsesAESKeys.ADAttribute, TypeConstants.Bool, true, TypeAdapterAccess.Read, true, AttributeSet.Default, new ToExtendedFormatDelegate(AttributeConverters.GetDelegateToExtendedFlagFromInt(0x100, false).Invoke), null, new ToSearchFilterDelegate(SearchConverters.GetDelegateToSearchFlagInInt(0x100, false).Invoke)); attributeConverterEntry[16] = new AttributeConverterEntry(ADTrustFactory <T> .ADTrustPropertyMap.IsTreeParent.PropertyName, ADTrustFactory <T> .ADTrustPropertyMap.IsTreeParent.ADAttribute, TypeConstants.Bool, true, TypeAdapterAccess.Read, true, AttributeSet.Default, new ToExtendedFormatDelegate(AttributeConverters.GetDelegateToExtendedFlagFromInt(0x400000, false).Invoke), null, new ToSearchFilterDelegate(SearchConverters.GetDelegateToSearchFlagInInt(0x400000, false).Invoke)); attributeConverterEntry[17] = new AttributeConverterEntry(ADTrustFactory <T> .ADTrustPropertyMap.IsTreeRoot.PropertyName, ADTrustFactory <T> .ADTrustPropertyMap.IsTreeRoot.ADAttribute, TypeConstants.Bool, true, TypeAdapterAccess.Read, true, AttributeSet.Default, new ToExtendedFormatDelegate(AttributeConverters.GetDelegateToExtendedFlagFromInt(0x800000, false).Invoke), null, new ToSearchFilterDelegate(SearchConverters.GetDelegateToSearchFlagInInt(0x800000, false).Invoke)); attributeConverterEntry[18] = new AttributeConverterEntry(ADTrustFactory <T> .ADTrustPropertyMap.TGTDelegation.PropertyName, ADTrustFactory <T> .ADTrustPropertyMap.TGTDelegation.ADAttribute, TypeConstants.Bool, true, TypeAdapterAccess.Read, true, AttributeSet.Default, new ToExtendedFormatDelegate(AttributeConverters.GetDelegateToExtendedFlagFromInt(0x200, false).Invoke), null, new ToSearchFilterDelegate(SearchConverters.GetDelegateToSearchFlagInInt(0x200, false).Invoke)); ADTrustFactory <T> .ADMappingTable = attributeConverterEntry; ADFactoryBase <T> .RegisterMappingTable(ADTrustFactory <T> .ADMappingTable, ADServerType.ADDS); }
internal static IdentityResolverDelegate GetCustomIdentityResolver(IdentityResolverDelegate function) { return(function); }
internal static ADObjectSearcher GetADObjectSearcherFromIdentity(ADEntity identityObj, string searchRoot, bool showDeleted, IADOPathNode structuralObjectFilter, IADOPathNode identityFilter, IdentityResolverDelegate[] identityResolvers, CmdletSessionInfo cmdletSessionInfo) { ADObjectSearcher identity = null; IADOPathNode aDOPathNode = null; bool flag = true; IdentityResolverDelegate[] identityResolverDelegateArray = identityResolvers; int num = 0; while (num < (int)identityResolverDelegateArray.Length) { IdentityResolverDelegate identityResolverDelegate = identityResolverDelegateArray[num]; if (identityObj.Identity == null) { identity = identityResolverDelegate(identityObj, searchRoot, cmdletSessionInfo, out flag); } else { identity = identityResolverDelegate(identityObj.Identity, searchRoot, cmdletSessionInfo, out flag); } if (identity == null) { num++; } else { if (!flag) { aDOPathNode = structuralObjectFilter; break; } else { IADOPathNode[] filter = new IADOPathNode[2]; filter[0] = identity.Filter; filter[1] = structuralObjectFilter; aDOPathNode = ADOPathUtil.CreateAndClause(filter); break; } } } if (identity == null) { if (searchRoot != null) { if (identityFilter != null) { IADOPathNode[] aDOPathNodeArray = new IADOPathNode[2]; aDOPathNodeArray[0] = identityFilter; aDOPathNodeArray[1] = structuralObjectFilter; aDOPathNode = ADOPathUtil.CreateAndClause(aDOPathNodeArray); identity = SearchUtility.BuildSearcher(cmdletSessionInfo.ADSessionInfo, searchRoot, ADSearchScope.Subtree); } else { object[] str = new object[2]; str[0] = identityObj.ToString(); str[1] = searchRoot; throw new ADIdentityNotFoundException(string.Format(CultureInfo.CurrentCulture, StringResources.IdentityNotFound, str)); } } else { throw new ADIdentityResolutionException(StringResources.IdentityResolutionPartitionRequired); } } identity.Filter = aDOPathNode; identity.ShowDeleted = showDeleted; return identity; }
internal static ADObjectSearcher GetADObjectSearcherFromIdentity(ADEntity identityObj, string searchRoot, bool showDeleted, IADOPathNode structuralObjectFilter, IADOPathNode identityFilter, IdentityResolverDelegate[] identityResolvers, CmdletSessionInfo cmdletSessionInfo) { ADObjectSearcher identity = null; IADOPathNode aDOPathNode = null; bool flag = true; IdentityResolverDelegate[] identityResolverDelegateArray = identityResolvers; int num = 0; while (num < (int)identityResolverDelegateArray.Length) { IdentityResolverDelegate identityResolverDelegate = identityResolverDelegateArray[num]; if (identityObj.Identity == null) { identity = identityResolverDelegate(identityObj, searchRoot, cmdletSessionInfo, out flag); } else { identity = identityResolverDelegate(identityObj.Identity, searchRoot, cmdletSessionInfo, out flag); } if (identity == null) { num++; } else { if (!flag) { aDOPathNode = structuralObjectFilter; break; } else { IADOPathNode[] filter = new IADOPathNode[2]; filter[0] = identity.Filter; filter[1] = structuralObjectFilter; aDOPathNode = ADOPathUtil.CreateAndClause(filter); break; } } } if (identity == null) { if (searchRoot != null) { if (identityFilter != null) { IADOPathNode[] aDOPathNodeArray = new IADOPathNode[2]; aDOPathNodeArray[0] = identityFilter; aDOPathNodeArray[1] = structuralObjectFilter; aDOPathNode = ADOPathUtil.CreateAndClause(aDOPathNodeArray); identity = SearchUtility.BuildSearcher(cmdletSessionInfo.ADSessionInfo, searchRoot, ADSearchScope.Subtree); } else { object[] str = new object[2]; str[0] = identityObj.ToString(); str[1] = searchRoot; throw new ADIdentityNotFoundException(string.Format(CultureInfo.CurrentCulture, StringResources.IdentityNotFound, str)); } } else { throw new ADIdentityResolutionException(StringResources.IdentityResolutionPartitionRequired); } } identity.Filter = aDOPathNode; identity.ShowDeleted = showDeleted; return(identity); }
internal static IdentityResolverDelegate GetAggregatedIdentityResolver(ADOperator op, IdentityResolverDelegate[] identityDelegates) { return (object identityObject, string searchBase, CmdletSessionInfo cmdletSessionInfo, out bool useSearchFilter) => IdentityResolverMethods.BuildAggregatedSearchFilterIdentityResolver(identityDelegates, op, identityObject, searchBase, cmdletSessionInfo, out useSearchFilter); }
internal static IdentityResolverDelegate GetCustomIdentityResolver(IdentityResolverDelegate function) { return function; }