public static PropertyValueCollection GetGroupAttribute(LDAPGroup domainGroup, string groupAttribute) { try { return(domainGroup.GetValues(groupAttribute)); } catch (Exception e) { _log.ErrorFormat("Wrong Group Attribute parameters: {0}. {1}", groupAttribute, e); } return(null); }
private static bool CheckGroupAttribute(LDAPGroup group, string groupAttr) { try { var groupAttribute = group.GetValues(groupAttr); if (groupAttribute == null) { _log.ErrorFormat("Wrong Group Attribute parameter: {0}", groupAttr); return(false); } } catch (Exception e) { _log.ErrorFormat("Wrong Group Attribute parameter: {0}. {1}", groupAttr, e); return(false); } return(true); }
public static bool UserExistsInGroup(LDAPGroup domainGroup, string memberString, string groupAttribute) { try { var members = domainGroup.GetValues(groupAttribute); if (memberString != null) { foreach (var member in members) { if (memberString.ToString().Equals(member.ToString(), StringComparison.InvariantCultureIgnoreCase)) { return(true); } } } } catch (Exception e) { _log.ErrorFormat("Wrong Group Attribute parameters: {0}. {1}", groupAttribute, e); } return(false); }
public static PropertyValueCollection GetGroupAttribute(LDAPGroup domainGroup, string groupAttribute) { try { return domainGroup.GetValues(groupAttribute); } catch (Exception e) { _log.ErrorFormat("Wrong Group Attribute parameters: {0}. {1}", groupAttribute, e); } return null; }
public static bool UserExistsInGroup(LDAPGroup domainGroup, string memberString, string groupAttribute) { try { var members = domainGroup.GetValues(groupAttribute); if (memberString != null) { foreach (var member in members) { if (memberString.ToString().Equals(member.ToString(), StringComparison.InvariantCultureIgnoreCase)) { return true; } } } } catch (Exception e) { _log.ErrorFormat("Wrong Group Attribute parameters: {0}. {1}", groupAttribute, e); } return false; }
private static bool CheckGroupAttribute(LDAPGroup group, string groupAttr) { try { var groupAttribute = group.GetValues(groupAttr); if (groupAttribute == null) { _log.ErrorFormat("Wrong Group Attribute parameter: {0}", groupAttr); return false; } } catch (Exception e) { _log.ErrorFormat("Wrong Group Attribute parameter: {0}. {1}", groupAttr, e); return false; } return true; }