Announcing the Saviynt Knowledge Exchange unifying the Saviynt forums, documentation, training,
and more in a single search tool across platforms. Read the announcement here.

Filtering AD accounts with specific Account Filter

ARNAB86
New Contributor III
New Contributor III

Hi Team,

We are trying to filter the specific account based on the condition below

we want to filter the acocunt based on account start with T followed by only five digit in Active directory in Object filter

Can you please suggest how to filter

Example : T00800

So it will only filter account started with T and followed by 5 digit. Others it will simply ignore

14 REPLIES 14

ARNAB86
New Contributor III
New Contributor III

Any suggestion 

ArvindKumar
New Contributor III
New Contributor III

Hi - Can you use this below filter, you can update the filter for object class/objectCategory accordingly if thats different. 

(&(objectCategory=user)(objectClass=user)(sAMAccountName=T[0-9][0-9][0-9][0-9][0-9]))

Regards,Arvind

 

rushikeshvartak
All-Star
All-Star

(&(objectCategory=user)(objectClass=user)(sAMAccountName=P\d{4}))


Regards,
Rushikesh Vartak
If you find the response useful, kindly consider selecting Accept As Solution and clicking on the kudos button.

Hi Rushikesh

After putting the above filter getting the below error

invalid escape sequence: [B@73e68f59

(&(objectCategory=user)(objectClass=user)(sAMAccountName=P\\d{4}))


Regards,
Rushikesh Vartak
If you find the response useful, kindly consider selecting Accept As Solution and clicking on the kudos button.

Hi Rushikesh

We have tried this (&(objectCategory=user)(objectClass=user)(sAMAccountName=T\\d{4}))

and run the accounts import job but none of the account are getting pulled in saviynt.

example of Account like "T67483"

Hi Rushikesh,

Can you please help us atleast it will search the account starting with T and followed by digit any number.

Hi Rushikesh 

can you please help us to filter only account start with T and followed by only numbers

like ex T12345 , T123456

Thanks

Arnab Pal

ARNAB86
New Contributor III
New Contributor III

We have tried this (&(objectCategory=user)(objectClass=user)(sAMAccountName=T\\d{4}))

and run the accounts import job but none of the account are getting pulled in saviynt.

example of Account like "T67483"

If you have ldap browser validate first as its working from java code 

Your LDAP filter (&(objectClass=user)(sAMAccountName=a?????)) is searching for user objects whose sAMAccountName attribute starts with 'a' and is followed by exactly five characters.

This LDAP filter is written in the standard LDAP filter syntax, where:

  • (& is the logical AND operator.
  • (objectClass=user) specifies that you are looking for objects of class 'user'.
  • (sAMAccountName=a?????) specifies the condition for the sAMAccountName attribute, where 'a' is followed by exactly five characters represented by the question marks.

Regards,
Rushikesh Vartak
If you find the response useful, kindly consider selecting Accept As Solution and clicking on the kudos button.

But we have criteria like it should start with let’s T and then followed by all digit and it can be any number of digit

like T12345 or T353535 or T5377337

Above logic should work


Regards,
Rushikesh Vartak
If you find the response useful, kindly consider selecting Accept As Solution and clicking on the kudos button.

Hi rushikesh,

we have tried with the above code it's now working

ARNAB86
New Contributor III
New Contributor III

Any suggestion please