public static string toUserAccountControl(this userAccountControl statusType) { string status = ""; switch (statusType) { case userAccountControl.Disable: status = ((int)userAccountControl.Disable).ToString(); break; case userAccountControl.DisablePasswordNotRequired: status = ((int)userAccountControl.DisablePasswordNotRequired).ToString(); break; case userAccountControl.Enable: status = ((int)userAccountControl.Enable).ToString(); break; case userAccountControl.EnablePasswordNotRequired: status = ((int)userAccountControl.EnablePasswordNotRequired).ToString(); break; default: break; } return(status); }
/// <summary> /// Parameterized constructor for InterDomain_Trust_Info compound value /// </summary> /// <param name="cn">The RDN of an inter domain trust account attribute, contains the NetBIOS name /// of the trusted domain account</param> /// <param name="accName">The sAMAccountName attribute contains the NetBIOS name /// of the trusted domain account </param> /// <param name="accType">In a domain trust account, the sAMAccountType attribute must have the value /// SAM_TRUST_ACCOUNT, in the Enumeration syntax</param> /// <param name="userAccCtrl">In a domain trust account, the userAccountControl attribute must have the flag /// ADS_UF_INTERDOMAIN_TRUST_ACCOUNT set</param> public InterDomain_Trust_Info(string cn, string accName, sAMAccountType accType, userAccountControl userAccCtrl) { this.cnAttribute = cn; this.sAMAccName = accName; this.interDomainAccType = accType; this.accControl = userAccCtrl; }