Hi.
I'm trying to make some LDAP queries through OLE.  I
don't need to supply any username or password detaisl
this way as it just uses the logged in user's
credentials.
Here's a code snippet
* * * * * *
use Win32::OLE qw(in);
use Win32::OLE::Variant;
use Win32::OLE::Const("Active DS"); #Get Constants for
ADS

$ldap_dc = "mydc";
$ldap_query_string = "CN=Microsoft
Exchange,CN=Services,CN=Configuration,DC=mydomain,DC=local";

my $ADServer =
Win32::OLE->GetObject("LDAP://$ldap_dc/$ldap_query_string");
        foreach my $element (in($ADServer)){
                print "class is $element->{Class} -\n";
                print "name is $element->{Name} -\n";
        }
}


* * * * 

Now if I use an LDAP browser to have a look at the
structure (as per what I have in the
$ldap_query_string variable) it shows two elements
underneath this LDAP path.  One is 'Active Directory
Connections' and the other is the name of a mail
store.  When I run the code above it shows both of
these elements (prints the class and the name).
The problem is that once I have the name of the store
I want to do another LDAP query further down into it's
part of the LDAP tree. It simply doesn't work.  If I
change the $ldap_query_string variable as per the name
of the store it doesn't return any values.
Essentially I want ot query the 'homeMDBBL' value of
each servers listed further down the LDAP structure to
get the number of mailboxes on each server.
Does anyone know why I can see these values using an
LDAP browser but can't see them using the code above?

Thanks.



        

        
                
____________________________________________________ 
On Yahoo!7 
Messenger - Make free PC-to-PC calls to your friends overseas. 
http://au.messenger.yahoo.com 

_______________________________________________
Perl-Win32-Admin mailing list
[email protected]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Reply via email to