Is it possible to search active directory for a group like this: - Give me all groups that contain the name sample?
In SQL I would write
SELECT * FROM GROUP WHERE NAME LIKE %sample%
I found on msdn some hints for expressions =, <= but not for a like. http://msdn.microsoft.com/en-us/library/system.directoryservices.directorysearcher.filter.aspx
Thanks for any hints.
Star acts like a wildcard in queries, so that filters like "a*" or "*a" should work.
If you are just looking to search for the name of the group, the link at the bottom of the page you linked tells you what to do but it does not take you directly to the page
For more information about the LDAP search string format, see "Search Filter Syntax" (I added the correct link)
Use a query like (&(objectclass=group)(cn=*sample*)) will be what you are looking for.
If you are searching if a user is a member of a group, not just a list of all groups that match a pattern, You need to use MemberOf and wildcards do not work on a MemberOf search
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With