I'm running a script that grabs a list of users from our LDAP directory and
synchronizes group memberships and permissions. Currently, I use code similar
to this, to get a list of members:
--snip--
my $currentUser = GetCurrentUser();
my $workingUser = new RT::User($currentUser);
my $systemUser = RT::User->new($RT::SystemUser);
# RT Group
$groupObj = new RT::Group($currentUser);
$groupObj->LoadUserDefinedGroup($groupName);
if ( not $groupObj->Id() )
{
print "Group ".$groupName." not found in RequestTracker\n";
next;
}
# Get our members into an array for easy work later.
$groupMembersObj = $groupObj->MembersObj();
my @rtMembers;
while ( $groupMember = $groupMembersObj->Next() )
{
$groupMemberUser = $groupMember->UserObj();
$workingUser->Load($groupMember->MemberId());
$workingUser->Name();
push(@rtMembers, $workingUser->Name());
}
--snip--
Basically, I load a group by name, and then loop through the array and grab
each user into an array. Is there a way I can do this for privileged user
names? I just want to get them into an array to work with them later.
Thanks,
Johnathan
--
Johnathan Bell
Internet System Administrator, Baker College
Office Phone: 810-766-4097
Office Hours: 7A-4P, M-F
_______________________________________________
http://lists.bestpractical.com/cgi-bin/mailman/listinfo/rt-users
Community help: http://wiki.bestpractical.com
Commercial support: [email protected]
Discover RT's hidden secrets with RT Essentials from O'Reilly Media.
Buy a copy at http://rtbook.bestpractical.com