List Info

Thread: exchange ldap problems using OLE




exchange ldap problems using OLE
user name
2006-04-11 13:41:17
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&
quot;;

my $ADServer =
Win32::OLE->GetObject("LDAP://$ldap_dc/$ldap_query_
string");
	foreach my $element (in($ADServer)){
		print "class is $element-> -\n";
		print "name is $element-> -\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.yah
oo.com 

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

about | contact  Other archives ( Real Estate discussion Medical topics )