Hello,

> Do I have to give password?
It all depends if you allow anonymous binding.
If you want a basic connection with user/pass you can:

---
use Mozilla::LDAP::Conn;
$conn = new Mozilla::LDAP::Conn("ldaphost", "389", $bind, $pswd);
----

$bind would be the user/admin or better known as the dn like:
$bind = "uid=admin,ou=Administrators,ou=TopologyManagement,o=NetscapeRoot";
----

If you allow anonymous searching you can use this (this is directly
from perldap.org)


-----------
$base = "o=netscape.com";
$conn = new Mozilla::LDAP::Conn("ldap", "389", "", ""); die "No LDAP
connection" unless $conn;

$entry = $conn->search($base, "subtree", "(uid=leif)");
if (! $entry)
{ # handle this event, no entries found, dude!
}
else
 {
 while ($entry)
  {
    $entry->printLDIF();
    $entry = $conn->nextEntry();
   }
-------------------
uid of leif would be your search pattern here though..

well I hope that helps.
chip

Reply via email to