--- Paul Sobey <[EMAIL PROTECTED]> wrote:

> > 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?
> 
> I'm not sure the keys lower down are readable by
> normal users - at least
> not on my Win2K3 domain. What privileges does your
> account have?
> 
> Paul
> 

Thanks for the reply.
The account I'm running under has 'Domain Admins'
rights.

Regards,
PJ



        

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

_______________________________________________
Perl-Win32-Admin mailing list
Perl-Win32-Admin@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Reply via email to