Saviynt unveils its cutting-edge Intelligence Suite products to revolutionize Identity Security!
Click HERE to see how Saviynt Intelligence is transforming the industry.
Saviynt Copilot Icon

Filter used in AD for account type

Ebharati
New Contributor II
New Contributor II

HI Team,

we have a requirement for filtering a particular type of account from AD.

For example: User ABC is having 2 different accounts, one with naming convention ABC and other with A-ABC.

How can we filter out A- accounts from the set of accounts.

Object filter used now is (&(objectCategory=person)(objectClass=user)(samAccountname=*)). 

How can we add samAccountname does not start with A-?

Please advise.

Any update or solution for this?

Thanks,

Ekata

[This message has been edited by moderator to merge reply comment]

2 REPLIES 2

Dhruv_S
Saviynt Employee
Saviynt Employee

Hi @Ebharati 

Please refer to the below Object filters. Please test it first in LDAP browser before using in a Saviynt connection. 

(&(objectCategory=person)(objectClass=user)(!(samAccountName=A*)))

(&(objectCategory=person)(objectClass=user)(!(samAccountname=A-*)))

Regards,

Dhruv Sharma

Manu269
All-Star
All-Star

Hello,

Below is one typical example which I am using for 1 of my case 

 If you specifically want to filter for `sAMAccountName` with a 5-digit number after 'A', you can use the following LDAP filter:


(&(objectClass=user)(sAMAccountName=A?????))

In this filter, each question mark (?) represents a single character, and there are five of them after 'A'. This ensures that you are looking for accounts where the `sAMAccountName` starts with 'A' and is followed by exactly five digits.

Regards
Manish Kumar
If the response answered your query, please Accept As Solution and Kudos
.