Tarasov
Tarasov

Reputation: 3695

How I use a "NOT" operator in the ldap filter

I use a filter for search a list of user in Active Directory...

Here is my filter example:

AD.filterung = "(&(objectClass=user)(objectCategory=user)(userAccountControl:1.2.840.113556.1.4.803:=2)(sn=)(|(telephoneNumber=)(mail=))(l=" + Werk + ")(cn=))";

It show me all user with UF_ACCOUNT_DISABLE but i want show all other User the not Unlock ...how I build a not operator in my filter. :(

Upvotes: 2

Views: 7014

Answers (1)

adam
adam

Reputation: 2264

have you tried simply with "!" ?

AD.filterung = "(&(objectClass=user)(objectCategory=user)(!userAccountControl:1.2.840.113556.1.4.803:=2)(sn=)(|(telephoneNumber=)(mail=))(l=" + Werk + ")(cn=))";

Upvotes: 3

Related Questions