Permalink
Browse files

FAQ.pod: update, mention Net::LDAP::Extra::AD

  • Loading branch information...
1 parent b23ae5f commit ed1907f54d5c82d90a678f4a09069eb9d3847973 @marschap marschap committed Oct 5, 2012
Showing with 26 additions and 7 deletions.
  1. +26 −7 lib/Net/LDAP/FAQ.pod
View
@@ -1313,10 +1313,29 @@ adding the new one.
When doing it as a user with administrative priviledges replacing
the unicodePwd's value with a new one is allowed too.
+Perl-ldap contains convenience methods for Active Directory that
+allow one to perform this task very easily.
+
Here's an example that demonstrates setting your own password
(again almost no error checking):
use Net::LDAP;
+ use Net::LDAP::Extra qw(AD);
+
+ my $ldap = Net::LDAP->new('ldaps://ads.domain.controller') or die "$@";
+
+ my $mesg = $ldap->bind('cn=Joe User,dc=your,dc=ads,dc=domain',
+ password => $oldPW);
+
+ $mesg = $ldap->change_ADpassword('cn=Joe User,dc=your,dc=ads,dc=domain',
+ $oldPW, $newPW);
+
+ $ldap->unbind();
+
+
+And the same for perl-ldap versions before 0.49:
+
+ use Net::LDAP;
use Unicode::Map8;
use Unicode::String qw(utf16);
@@ -1331,7 +1350,7 @@ Here's an example that demonstrates setting your own password
my $ldap = Net::LDAP->new('ldaps://ads.domain.controller') or die "$@";
my $mesg = $ldap->bind('cn=Joe User,dc=your,dc=ads,dc=domain',
- password => 'oldPW');
+ password => $oldPW);
$mesg = $ldap->modify('cn=Joe User,dc=your,dc=ads,dc=domain',
changes => [
@@ -1346,7 +1365,12 @@ Here's an example that demonstrates setting your own password
Perl-ldap does not do server failover, however there are several
programming options for getting around this situation.
-Here is one possible solution.
+Here is one possible solution:
+
+ $ldaps = Net::LDAPS->new([ $ldapserverone, $ldapservertwo ],
+ port=>636, timeout=>5) or die "$@";
+
+For perl-ldap versions before 0.27, thes same goal can be achieved using:
unless ( $ldaps =
Net::LDAPS->new($ldapserverone,
@@ -1358,11 +1382,6 @@ Here is one possible solution.
"Can't connect to $ldapserverone or $ldapservertwo via LDAPS: $@";
}
-As of version 0.27 of perl-ldap the above can be expressed much simpler:
-
- $ldaps = Net::LDAPS->new([ $ldapserverone, $ldapservertwo ],
- port=>636, timeout=>5) or die "$@";
-
=head1 Using X.509 certificates.

0 comments on commit ed1907f

Please sign in to comment.