internal static object FromNameToTopologyDN <F, O>(object entity, string extendedAttribute, CmdletSessionInfo cmdletSessionInfo) where F : ADFactory <O>, new() where O : ADEntity, new() { string str = ADPathModule.MakePath(cmdletSessionInfo.ADRootDSE.ConfigurationNamingContext, "CN=Sites,", ADPathFormat.X500); return(AttributeConverters.GetAttributeValueFromObjectName <F, O>(entity, str, null, extendedAttribute, cmdletSessionInfo)); }
internal static string[] GetClaimTypeName(ADClaimType[] claims, CmdletSessionInfo cmdletSessionInfo, string extendedAttribute) { List <string> strs = new List <string>(); ADClaimType[] aDClaimTypeArray = claims; for (int i = 0; i < (int)aDClaimTypeArray.Length; i++) { ADClaimType aDClaimType = aDClaimTypeArray[i]; string str = ADPathModule.MakePath(cmdletSessionInfo.ADRootDSE.ConfigurationNamingContext, "CN=Claims Configuration,CN=Services,", ADPathFormat.X500); str = ADPathModule.MakePath(str, "CN=Claim Types,", ADPathFormat.X500); string attributeValueFromObjectName = (string)AttributeConverters.GetAttributeValueFromObjectName <ADClaimTypeFactory <ADClaimType>, ADClaimType>(aDClaimType, str, "Name", extendedAttribute, cmdletSessionInfo); strs.Add(attributeValueFromObjectName); } return(strs.ToArray()); }
private bool ADCentralAccessRulePreCommitFSRoutine(ADFactory <T> .DirectoryOperation operation, T instance, ADParameterSet parameters, ADObject directoryObj) { if (ADFactory <T> .DirectoryOperation.Update == operation) { if (directoryObj.ModifiedProperties.Contains("msAuthz-EffectiveSecurityPolicy") || directoryObj.RemovedProperties.Contains("msAuthz-EffectiveSecurityPolicy") || directoryObj.AddedProperties.Contains("msAuthz-EffectiveSecurityPolicy")) { string str = ADPathModule.MakePath(base.CmdletSessionInfo.ADRootDSE.ConfigurationNamingContext, "CN=Central Access Rules,CN=Claims Configuration,CN=Services,", ADPathFormat.X500); string attributeValueFromObjectName = AttributeConverters.GetAttributeValueFromObjectName <ADCentralAccessRuleFactory <ADCentralAccessRule>, ADCentralAccessRule>(directoryObj.DistinguishedName, str, "CurrentAcl", "PreviousAcl", base.CmdletSessionInfo) as string; directoryObj["msAuthz-LastEffectiveSecurityPolicy"].Value = attributeValueFromObjectName; } return(true); } else { return(false); } }
private bool RemoveADClaimTypeCmdletValidationCSRoutine() { string[] strArrays; SwitchParameter force = this._cmdletParameters.Force; if (!force.ToBool()) { ADClaimType identity = this._cmdletParameters.Identity; object attributeValueFromObjectName = AttributeConverters.GetAttributeValueFromObjectName <ADClaimTypeFactory <ADClaimType>, ADClaimType>(identity, this.GetDefaultPartitionPath(), "msDS-ClaimSharesPossibleValuesWithBL", "msDS-ClaimSharesPossibleValuesWithBL", this.GetCmdletSessionInfo()); if (attributeValueFromObjectName != null) { string str = attributeValueFromObjectName as string; if (str == null) { strArrays = attributeValueFromObjectName as string[]; } else { string[] strArrays1 = new string[1]; strArrays1[0] = str; strArrays = strArrays1; } object[] identifyingString = new object[1]; identifyingString[0] = identity.IdentifyingString; string str1 = string.Format(CultureInfo.CurrentCulture, StringResources.RemoveClaimTypeSharesValueWithError, identifyingString); if (strArrays != null) { for (int i = 0; i < 5 && i < (int)strArrays.Length; i++) { str1 = string.Concat(str1, Environment.NewLine, strArrays[i]); } } base.WriteError(new ErrorRecord(new ADException(str1), "RemoveADClaimType:RemoveADClaimTypeCmdletValidationCSRoutine", ErrorCategory.InvalidData, null)); return(false); } } return(true); }
internal static object FromNameToSchemaDN(object entity, string extendedAttribute, CmdletSessionInfo cmdletSessionInfo) { return(AttributeConverters.GetAttributeValueFromObjectName <ADSchemaObjectFactory <ADSchemaObject>, ADSchemaObject>(entity, cmdletSessionInfo.ADRootDSE.SchemaNamingContext, null, extendedAttribute, cmdletSessionInfo)); }