Re: Re: Confused about LDAP authentication with Active Directory

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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-unsubscribe@xxxxxxxxxxxxxxxx
  "   from the digest: users-digest-unsubscribe@xxxxxxxxxxxxxxxx
For additional commands, e-mail: users-help@xxxxxxxxxxxxxxxx


[Index of Archives]     [Open SSH Users]     [Linux ACPI]     [Linux Kernel]     [Linux Laptop]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Squid]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]

  Powered by Linux