Hello. This is my first post to the list so please excuse any ignorance on my
part.
I am trying to find all user accounts in a Windows 2000 Active Directory that
are not disabled using the Net::LDAP module. This is the code I'm using for my
search:
my $base = 'OU=Domain Users,DC=mydomain,DC=com';
my $filter =
'(&(objectclass=user)(objectCategory=person)(!useraccountcontrol:1.2.840.113556.1.4.803:=2))';
my @attrs = ['cn','mail','telephoneNumber'];
my $scope = 'sub';
my $searchRes = $ldap->search(
base => $base,
filter => $filter,
scope => $scope,
attrs => @attrs
);
I worked out the filter using LDP.exe, so I'm fairly certain it works and is
correct. It returns all of the active users when run in LDP. However, this
search returns no results when I run the perl script. If I remove the
useraccountcontrol section from my filter and run the script, it will return
all users (enabled and disabled). I am confused as to why the filter would work
through LDP and not in my perl script. Any guidance is greatly appreciated.
___________________________
Aaron Giuoco
[EMAIL PROTECTED]