ldap query with wildcard

…衆ロ難τιáo~ 提交于 2019-12-12 04:52:20

问题


I have a query like below

(|(distinguishedName=cn=Game_BI_CHARGE_BACK,ou=Groups,ou=FC,dc=na,dc=company,dc=com)(distinguishedName=cn=Game_BI_Compliance,ou=Groups,ou=FC,dc=na,dc=company,dc=com)(distinguishedName=cn=Game_BI_Finance,ou=Groups,ou=FC,dc=na,dc=company,dc=com)(distinguishedName=cn=Game_BI_GP,ou=Groups,ou=FC,dc=na,dc=company,dc=com)(distinguishedName=cn=Game_BI_MANAGED_CARE,ou=Groups,ou=FC,dc=na,dc=company,dc=com)(distinguishedName=cn=Game_BI_MEDICAID,ou=Groups,ou=FC,dc=na,dc=company,dc=com)(distinguishedName=cn=Game_BI_PowerUser,ou=Groups,ou=FC,dc=na,dc=company,dc=com)(distinguishedName=cn=Game_BI_TRADE,ou=Groups,ou=FC,dc=na,dc=company,dc=com)(distinguishedName=cn=Game_BI_TRICARE,ou=Groups,ou=FC,dc=na,dc=company,dc=com))

I want to shorten it using wildcard, All the group names start with Game_BI. The above query works, I just want to make it short.

Thanks Shashi


回答1:


You cannot use the wildcard * character to filter the distinguishedName attribute - only exact matches will work. You can read more about that here, under the LDAP Clauses section :

http://social.technet.microsoft.com/wiki/contents/articles/5392.active-directory-ldap-syntax-filters.aspx

However, according to your current filter, you could do a wildcard search by canonical name, or cn, and get the same result :

(&(objectClass=group)(cn=Game_BI*))

That says, "Give me all the groups that have a canonical name that begins with "Game_BI".



来源:https://stackoverflow.com/questions/32829104/ldap-query-with-wildcard

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!