public bool Equals(User other) { //Check whether the compared object is null. if (Object.ReferenceEquals(other, null)) { return(false); } //Check whether the compared object references the same data. if (Object.ReferenceEquals(this, other)) { return(true); } //Check whether the properties are equal. return(SamAccountName.Equals(other.SamAccountName)); }
/// <summary> /// Determines whether this user is an service account. /// </summary> /// <returns><c>true</c> if this user is an service account; otherwise, <c>false</c>.</returns> public bool IsServiceAccount() { return(SamAccountName.EndsWith("-SVC", StringComparison.InvariantCultureIgnoreCase) || DistinguishedName.Contains(",OU=Service Accounts,")); }
/// <summary> /// Determines whether this user is an application account. /// </summary> /// <returns><c>true</c> if this user is an application account; otherwise, <c>false</c>.</returns> public bool IsApplicationAccount() { return(SamAccountName.EndsWith("-APP", StringComparison.InvariantCultureIgnoreCase) || DistinguishedName.Contains(",OU=Application Accounts,")); }
/// <summary> /// Determines whether this user is an administrative account. /// </summary> /// <returns><c>true</c> if this user is an administrative account; otherwise, <c>false</c>.</returns> public bool IsAdministrativeAccount() { return(SamAccountName.EndsWith("-ADM", StringComparison.InvariantCultureIgnoreCase) || DistinguishedName.Contains(",OU=Administrative Accounts,")); }