Ishan Liyanage
Ishan Liyanage

Reputation: 2407

LDAP/Active Directory search excluding sAMAccountName with spaces

I am integrating with 3rd party LDAP where some sAMAccountName contains spaces e.g sAMAccountName=Ishan Liyanage

Is there any possibility that I can exclude sAMAccountName with spaces while searching?

I know I can use logical not to exclude those, but it not an option as there so many with spaces

Upvotes: 0

Views: 1395

Answers (1)

Anya Shenanigans
Anya Shenanigans

Reputation: 94749

Well you can add the logical negation of spaces using an additional search term like:

!(sAMAccountName=* *)

but, TBH, why such a restriction - is it for linux interop? If that's the case then you can use the uid field or the prefix of the principal name: userPrincipalName=<user>@*

Upvotes: 1

Related Questions