[rt-users] How to list all enabled users in Perl script?
Nathan Cutler
presnypreklad at gmail.com
Mon Sep 2 10:04:27 EDT 2013
Greetings:
RT 4.0.17. In the web UI, when I list all enabled users by selecting
'%' I get a list of about 152 users (approximately). Now, I have
written a Perl script that is supposed to list all enabled RT users.
When I run it, it finds 147 users and lists them in alphabetical
order. But approximately 5 users at the end of the alphabet ('Name'
starting with 'v', 'w', 'x', 'y', or 'z') are missing. For the life of
me I can't figure out why. Any ideas?
use strict;
use warnings;
use RT;
use RT::User;
use RT::Users;
BEGIN {
RT->LoadConfig;
RT->Init;
}
my $RT_enabled_users = RT::Users->new($RT::SystemUser);
$RT_enabled_users->LimitToEnabled;
my $loop_count = 0;
while (my $current_user = $RT_enabled_users->Next) {
$loop_count += 1;
my $uid = $current_user->Name;
my $real_name = $current_user->RealName;
my $rt_email = $current_user->EmailAddress;
print "$loop_count: '$uid' -- $real_name -- $rt_email\n";
}
print "Loop count: $loop_count\n";
Thanks alot,
Nathan
More information about the rt-users
mailing list