Problem Solved! Found the solution in an earlier post.

Thanks, Paul Connolly!


"Forumuser" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> In an effort to learn Net::LDAP (and LDAP) I tried to print the tree under
> the root-domain. But I get the output shown. I know there are other DN's
for
> Users and Computers as shown by the Server Tools provided my microsoft. I
> even tried to print the tree under DN corresponding to "Users" and
> "Computers" but nothing shows up. Obviously I am doing something wrong.
> Could somebody please point it out to me?
>
> I am trying to access the Domaini controller over LAN
>
> Thanks
>
> Program and output:
>
> use lib "d:/perl-ldap-0.31/lib";
> use Net::LDAP;
>
> $ldap = Net::LDAP->new("10.0.1.4", port=>'389') or die "couldn't connect
> \n";
> $r = $ldap->bind();
> print "errorcode = ", $r->code, "\n";
> $r = $ldap->search( base => 'dc=company,dc=com', scope => 'subtree',
> filter=>"(objectClass=*)");
> die $r->error if $r->code;
>
> $count=0;
> foreach my $entry ($r->entries) {
>  $count++;
>  print "entry DN=", $entry->dn, "\n";
> }
> print "count=$count\n";
> print "success!!!\n";
>
>
> ***output***
>
> entry DN=DC=company,DC=com
> entry
DN=DC=@,DC=RootDNSServers,CN=MicrosoftDNS,CN=System,DC=company,DC=com
> entry
>
DN=DC=a.root-servers.net,DC=RootDNSServers,CN=MicrosoftDNS,CN=System,DC=comp
> any,DC=com
> entry
>
DN=DC=b.root-servers.net,DC=RootDNSServers,CN=MicrosoftDNS,CN=System,DC=comp
> any,DC=com
> entry
>
DN=DC=c.root-servers.net,DC=RootDNSServers,CN=MicrosoftDNS,CN=System,DC=comp
> any,DC=com
> entry
>
DN=DC=d.root-servers.net,DC=RootDNSServers,CN=MicrosoftDNS,CN=System,DC=comp
> any,DC=com
> entry
>
DN=DC=e.root-servers.net,DC=RootDNSServers,CN=MicrosoftDNS,CN=System,DC=comp
> any,DC=com
> entry
>
DN=DC=f.root-servers.net,DC=RootDNSServers,CN=MicrosoftDNS,CN=System,DC=comp
> any,DC=com
> entry
>
DN=DC=g.root-servers.net,DC=RootDNSServers,CN=MicrosoftDNS,CN=System,DC=comp
> any,DC=com
> entry
>
DN=DC=h.root-servers.net,DC=RootDNSServers,CN=MicrosoftDNS,CN=System,DC=comp
> any,DC=com
> entry
>
DN=DC=i.root-servers.net,DC=RootDNSServers,CN=MicrosoftDNS,CN=System,DC=comp
> any,DC=com
> entry
>
DN=DC=j.root-servers.net,DC=RootDNSServers,CN=MicrosoftDNS,CN=System,DC=comp
> any,DC=com
> entry
>
DN=DC=k.root-servers.net,DC=RootDNSServers,CN=MicrosoftDNS,CN=System,DC=comp
> any,DC=com
> entry
>
DN=DC=l.root-servers.net,DC=RootDNSServers,CN=MicrosoftDNS,CN=System,DC=comp
> any,DC=com
> entry
>
DN=DC=m.root-servers.net,DC=RootDNSServers,CN=MicrosoftDNS,CN=System,DC=comp
> any,DC=com
> count=15
> success!!!
>
>


Reply via email to