Hi,
I wanna list enabled accounts in AD and i have a line
strFilter = "(&(objectCategory=person)(objectClass=user)" &
"(userAccountControl:1.2.840.113556.1.4.803:=2))"
that lists disabled accounts. I`ve tried using
strFilter = "(&(objectCategory=person)(objectClass=user)" &
"(userAccountControl:1.2.840.113556.1.4.803:<>2))"
but thata didn`t work. How do I do this?

Regards Jason

Re: Not equal by Richard

Richard
Thu May 26 10:59:51 CDT 2005

Jason wrote:

> I wanna list enabled accounts in AD and i have a line
> strFilter = "(&(objectCategory=person)(objectClass=user)" &
> "(userAccountControl:1.2.840.113556.1.4.803:=2))"
> that lists disabled accounts. I`ve tried using
> strFilter = "(&(objectCategory=person)(objectClass=user)" &
> "(userAccountControl:1.2.840.113556.1.4.803:<>2))"
> but thata didn`t work. How do I do this?

The "Not" operator is "!". You prepend this to the clause to negate it. For
more info, see:

http://www.rlmueller.net/ADOSearchTips.htm

--
Richard
Microsoft MVP Scripting and ADSI
Hilltop Lab web site - http://www.rlmueller.net
--