The CreatorCon Call for Content is officially open! Get started here.

LDAP search filters

harry24
Tera Contributor

Hello ,

 

How to create LDAP filter which will search for  a string that contains name , name+1 ,name+2 etc

5 REPLIES 5

DrewW
Mega Sage

Example searching for Common Name contains name1 or name2.

(|(cn=*name1*)(cn=*name2*))

 

harry24
Tera Contributor

Hi ,

The numbers can be anything after name, how to use wildcard here , if you could help will be great 

Then you need to leave that out of the query.  So

(|(cn=*xyz*)(cn=*abc*))

The LDAP Servers setup that ServiceNow has does not allow you to dynamically change the query when it runs.

 

Or you need to use the AD Integration Hub spoke to use code to generate the query and run it against LDAP.

 

Knowing what you are trying to do over all would help in pointing you to an option.

 

harry24
Tera Contributor

Integration is already done , i want to create username for which I need to check if the username already exists if it exists add 1 at the end , so for example if my username is abel and Abel already exists then it should create abel1 , now for next time again my username is abel it should consider all existing record so now it has abel and abel1 so now it should create abel2 and so on