Ed Avis schrieb:
Marc Patermann <hans.moser <at> ofd-sth.niedersachsen.de> writes:

You mean the DN contains a component with a space in it!?
ou=WCL user,dc=foo,dc=bar
Ah... 'ou'... I was using 'cn'.
This was only an example. Actually I know nothing about the DIT in AD. :)


The corrected search query works, as
demonstrated by the following perl script:

    #!/usr/bin/perl
    die "usage: $0 host domain username password\n" if @ARGV != 4;
    my ($host, $domain, $username, $password) = @ARGV;
    use Net::LDAP;
    my $ldap = new Net::LDAP($host) or die $@;
    my $mesg = $ldap->bind("$domain\\$username", password => $password);
    $mesg->code && die $mesg->error;
    $mesg = $ldap->search(base => 'ou=WCL Users,ou=WCL Logins,dc=wcl,dc=local',
                          filter => '(objectClass=*)');
    $mesg->code && die $mesg->error;
    $_->dump foreach $mesg->entries;

This spits out details of every user in the domain, with the sAMAccountName
being the user's login.
You were lucky. :)


Marc


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscr...@httpd.apache.org
  "   from the digest: users-digest-unsubscr...@httpd.apache.org
For additional commands, e-mail: users-h...@httpd.apache.org

Reply via email to