![]() String filterAttribute = (String)result.Properties įoreach(string groupMemberShipName in result.Properties)Ĭonsole. Search.Filter = "(SAMAccountName=" + strLdapUserName + ")" AND does NOT have Directorate in the Office field. Hello all So Im looking for an LDAP query for Active Directory that will match the following requirements: Is a User. the object is needed to fire off the ldap connectionĭirectorySearcher search = new DirectorySearcher(entry) 5 Comments 1 Solution 2473 Views Last Modified. DirectoryEntry entry = new DirectoryEntry("LDAP://xxxxxxxx/OU=xxxxxxx,DC=xxxxxx,DC=xxxxx,DC=xxxxxx", strLdapUserName, strLdapPassword) The 'catch' statement will trap a wrong user name or password. Example below will display all the groups for that specific user name. ![]() I did it by pushing the username and password and loading the "memberOf" property into the 'search' instance. I needed a method of authenticating a user and a check to see if they were in a specific user group.
0 Comments
Leave a Reply. |