More LDAP Query Examples and more AD Specific LDAP Query Examples
(objectClass=group)
(memberOf=CN=Admin,OU=Security,DC=DOM,DC=NT)
(memberOf:1.2.840.113556.1.4.1941:=CN=GroupOne,OU=Security Groups,OU=Groups,DC=YOURDOMAIN,DC=NET)
Or to retrieve only users that are members:
(&(objectClass=user)(memberof:1.2.840.113556.1.4.1941:=CN=GroupOne,OU=Security Groups,OU=Groups,DC=YOURDOMAIN,DC=NET)For information on why this Extensible Match rule works see 1.2.840.113556.1.4.1941 or LDAP_MATCHING_RULE_IN_CHAIN
(groupType:1.2.840.113556.1.4.803:=2147483648)For information on why this works see How To use Filtering for Bit Fields and 1.2.840.113556.1.4.803 or LDAP_MATCHING_RULE_BIT_AND
(&(objectClass=group)(!member=*))
(&(objectCategory=group)(groupType:1.2.840.113556.1.4.803:=2147483650))
(&(objectCategory=group)(groupType:1.2.840.113556.1.4.803:=2147483652))
(&(objectCategory=group)(groupType:1.2.840.113556.1.4.803:=2147483656))
(&(objectCategory=group)(!(groupType:1.2.840.113556.1.4.803:=2147483648)))
(&(objectCategory=group)(groupType:1.2.840.113556.1.4.803:=2)(!(groupType:1.2.840.113556.1.4.803:=2147483648)))
(&(objectCategory=group)(groupType:1.2.840.113556.1.4.803:=4)(!(groupType:1.2.840.113556.1.4.803:=2147483648)))
(&(objectCategory=group)(groupType:1.2.840.113556.1.4.803:=8)(!(groupType:1.2.840.113556.1.4.803:=2147483648)))
(&(objectClass=group)(whenChanged>=20081231000000.0Z))
The handy search I found is:
(member:1.2.840.113556.1.4.1941:=CN=John Smith,DC=MyDomain,DC=NET)
Where CN=John Smith,DC=MyDomain,DC=NET is the user's FDN and 1.2.840.113556.1.4.1941 is the special OID Rule ID LDAP_MATCHING_RULE_IN_CHAIN as you used above (and is documented here.
--scott, 02-Apr-2012 21:48