
Net::LDAP::Class::Group::AD - Active Directory group class

# create a subclass for your local Active Directory
package MyLDAPGroup;
use base qw( Net::LDAP::Class::Group::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 MyLDAPGroup;
my $group = MyLDAPGroup->new( ldap => $ldap, cn => 'foobar' );
$group->read_or_create;
my $users = $group->users_iterator( page_size => 50 );
while ( my $user = $users->next ) {
printf("user %s in group %s\n", $user, $group);
}

Net::LDAP::Class::Group::AD isa Net::LDAP::Class::Group 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.

Required MethodMaker method for retrieving primary_users from LDAP.
Returns array or array ref based on context, of related User objects who have this group assigned as their primary group.
Returns a Net::LDAP::Class::Iterator object for all the related primary users for the group.
This is the same data as primary_users() returns, but is more efficient since it pages the results and only fetches one at a time.
Required MethodMaker method for retrieving secondary_users from LDAP.
Returns array or array ref based on context, of related User objects who have this group assigned as a secondary group (memberOf).
Consider using secondary_users_iterator() instead, especially if you have large groups. See Net::LDAP::Class::Iterator for an explanation. This method is just a wrapper around secondary_users_iterator().
Like primary_users_iterator, only for secondary_users.
This is the same data as secondary_users() returns, but is more efficient since it pages the results and only fetches one at a time.
Alias for calling primaryGroupToken() method. Note that primaryGroupToken is dynamically generated by the server and cannot be assigned (set).
Add a group to the database.
May be called as a class method with explicit cn key/value pair.
Save new cn (name) for an existing group.
Removes array ref of actions for removing the Group.
You may call this as a class method with an explicit cn key/value pair.
Push user_object onto the list of member() DNs, checking that user_object is not already on the list.
Drop user_object from the list of member() DNs, checking that user_object is already on the list.

Peter Karman, <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.

You can find documentation for this module with the perldoc command.
perldoc Net::LDAP::Class
You can also look for information at:

The Minnesota Supercomputing Institute http://www.msi.umn.edu/ sponsored the development of this software.

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.
