cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
1507
Views
18
Helpful
11
Replies

how to cutomize LDAP filter in CUCM to match many attributes

NetExprt
Level 1
Level 1

Hi all ,

I need to apply LDAP filter in call manager that apply the below in  once customize filter.

1- filter LDAP users whom first name start with "test" or "serv"

2- filter LDAP users whom don't have Email address.

 

Thanks

 

 

11 Replies 11

you can find many threads in the support forum related to the LDAP custom filter. Please go through the below reference and you may find it easy to construct as per your requirement.  

https://www.uccollabing.com/cucm-ldap-filters-explained-find-ldap-attributes-easily/ 

 

https://community.cisco.com/t5/collaboration-voice-and-video/ldap-custom-filter-cucm-8-x/ta-p/3125699 

 

Please let us know if you still find it too difficult. 

Regards, 

 

****Please rate the post if you find it usefull. 

This is the standard filter that CM will apply even if you don't have defined any custom LDAP filter.

Standard default LDAP filter for users
(&(objectclass=user)(!(objectclass=Computer))(!(UserAccountControl:1.2.840.113556.1.4.803:=2)))

If you would want to add the criteria that you list you would do this.

(&(objectclass=user)(!(objectclass=Computer))(!(UserAccountControl:1.2.840.113556.1.4.803:=2))(email=*)(|(givenName=test*)(givenName=serv*)))

To explain the part some I loaded the filter into a LDAP browser to get a graphical depiction of it.

Snag_23eedf2.png



Response Signature


thanks for your response 

I have applied the same and did sync but it didn't filter anything

please advise

 

Would you mind to rephrase what you want as the result of the filter? In the event that I might have misread what you wrote from the start.



Response Signature


Exactly I need to NOT sync all users that match the below condition (XOR)

1- don't have email ID 

2- first name starts with SVC

3- first name starts with health

when I applied the filter which I shared in last message , it did filter many other users and impacted the cisco agents .

Then your filter should be this.

(&(objectclass=user)(!(objectclass=Computer))(!(UserAccountControl:1.2.840.113556.1.4.803:=2))(email=*)(|(!(givenName=SVC*))(!(givenName=health*))))

In the LDAP builder it would look like this.

Snag_5d6899.png

The difference is that you need to negate the given name part to filter them out. For email that's not needed as you're filtering on that this field has a value, any user with no email address should be filtered out.



Response Signature


To be clear the filter that you have built would include the users that the filter match. If that is not what you intend the filter needs to be modified.



Response Signature


how can we exclude specific OU from sync ?

 

If the OU is visible in the search path you cannot exclude it as such from the synchronous with a LDAP filter as CM do not support filtering on members of a OU. What you can do is filter on users that belongs to a security group and without to much hassle you should be able to write a PowerShell script that looks for users in the OU and adds them into the group. With that you should effectively have filtered out users in the OU.



Response Signature


You can't filter the OU, instead of syncing from full domain, make multiple LDAP directory and sync each OU. But remember that you can have only 20 LDAP directories.

 



Response Signature


Remove read rights to that OU on the user you configured for the sync.

HTH

java

if this helps, please rate