Hi All,
 
I'm writing a script using Net::LDAP to query Active Directory, and some of the 
Distinguished Names I'm looking up include brackets.  I've read the 
Net::LDAP::Filter perldoc which says that the sequences "\(" and "\28" can be 
used for an open bracket, but this doesn't work for me.  Anyone know what I'm 
doing wrong?
 
Here's some basic example code which doesn't work for me:
 
=====
use Net::LDAP;
use Net::LDAP::Filter;
 
$ldap = Net::LDAP->new("dc.our.domain.local") or die("$@");
$mesg = $ldap->bind('CN=account,OU=Users,DC=our,DC=domain,DC=local', password 
=> 'password') or die("Unable to bind to LDAP: $@");
$filter = Net::LDAP::Filter->new("(distinguishedName=CN=John Smith 
(Finance),OU=Users,DC=our,DC=domain,DC=local)");
$mesg = $ldap->search(
        base => "DC=our,DC=domain,DC=local",
        filter => $filter,
       );
 
foreach my $entry ($mesg->entries) { $entry->dump; }
=====
 
I've tried using both a filter object and specifying the filter as a literal to 
the search method, to no avail.  Please help!
 
Thanks,
-- 
Steven Hirschorn 
Systems Support Engineer 
ICT Department 
The National Archives 
 


Please don't print this e-mail unless you really need to.

---------------------------------------------------------------------------------

National Archives Disclaimer


This email message (and attachments) may contain information that is 
confidential  to The National Archives.  If you are not the intended recipient 
you cannot use, distribute or copy the message or attachments.  In such a case, 
please notify the sender by return email immediately and erase all copies of 
the message and attachments.  Opinions, conclusions and other information in 
this message and attachments that do not relate to the official business of The 
National Archives are neither given nor endorsed by it.

------------------------------------------------------------------------------------

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

Reply via email to