Net::LDAP::Class::User::AD - Active Directory User class
# subclass this class for your local LDAP package MyLDAPUser; use base qw( Net::LDAP::Class::User::AD );
__PACKAGE__->metadata->setup( base_dn => 'dc=mycompany,dc=com', attributes => __PACKAGE__->AD_attributes, unique_attributes => __PACKAGE__->AD_unique_attributes, ); 1; # then use your class my $ldap = get_and_bind_LDAP_object(); # you write this use MyLDAPUser; my $user = MyLDAPUser->new( ldap => $ldap, sAMAccountName => 'foobar' ); $user->read_or_create; for my $group ($user->group, @{ $user->groups }) { printf("user %s in group %s\n", $user, $group); }
Net::LDAP::Class::User::AD isa Net::LDAP::Class::User implementing the Active Directory LDAP schema.
Returns array ref of a subset of the default Active Directory attributes. Only a subset is used since the default schema contains literally 100s of attributes. The subset was chosen based on its similarity to the POSIX schema.
Returns array ref of unique Active Directory attributes.
All the init_* methods can be specified to the new() constructor without the init_ prefix.
Required MethodMaker method for retrieving primary group from LDAP.
Returns an object of type group_class().
Returns human-readable version of lastLogon attribute.
Returns human-readable version of pwdLastSet attribute.
Returns epoch time for attribute_name.
Returns human-readable time when password will expire, based on pwdLastSet attribute and the domain-level maxPwdAge value.
Required MethodMaker method for retrieving secondary groups from LDAP.
Returns array or array ref (based on context) of objects of type group_class().
Returns a Net::LDAP::Class::Iterator object with all the secondary groups. This is the same data as fetch_groups() but as an iterator instead of an array.
See the advice about iterators versus arrays in Net::LDAP::Class::Iterator.
Alias for primaryGroupID() attribute.
Returns \home.
Returns an empty string.
Convenience wrapper around unicodePwd() attribute method.
This method will verify plain_password is in the correct encoding that AD expects and set it in the ldap_entry().
If no argument is supplied, returns the string set in ldap_entry() (if any).
Returns hash ref suitable for creating a Net::LDAP::Batch::Action::Add.
May be called as a class method with explicit uid and uidNumber key/value pairs.
Utility method for generating default values for various attributes. Called by both action_for_create() and action_for_update().
Returns array of values in this order:
$groupname, $gid, $givenName, $sn, $cn, $email
Returns array ref suitable for creating a Net::LDAP::Batch::Action::Update.
Returns action suitable for creating a Net::LDAP::Batch::Action::Delete.
Peter Karman, <karman at cpan.org>
<karman at cpan.org>
Please report any bugs or feature requests to bug-net-ldap-class at rt.cpan.org, or through the web interface at http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Net-LDAP-Class. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.
bug-net-ldap-class at rt.cpan.org
You can find documentation for this module with the perldoc command.
perldoc Net::LDAP::Class
You can also look for information at:
AnnoCPAN: Annotated CPAN documentation
http://annocpan.org/dist/Net-LDAP-Class
CPAN Ratings
http://cpanratings.perl.org/d/Net-LDAP-Class
RT: CPAN's request tracker
http://rt.cpan.org/NoAuth/Bugs.html?Dist=Net-LDAP-Class
Search CPAN
http://search.cpan.org/dist/Net-LDAP-Class
The Minnesota Supercomputing Institute http://www.msi.umn.edu/ sponsored the development of this software.
http://www.msi.umn.edu/
Copyright 2008 by the Regents of the University of Minnesota. All rights reserved.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
Net::LDAP
To install Net::LDAP::Class, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Net::LDAP::Class
CPAN shell
perl -MCPAN -e shell install Net::LDAP::Class
For more information on module installation, please visit the detailed CPAN module installation guide.