[rt-users] Bulk Adding Users
Torsten Brumm
torsten.brumm at googlemail.com
Mon Mar 19 03:48:53 EDT 2007
Hi,
i'm using this tiny scrip:
#!/usr/bin/perl
use strict;
use warnings;
BEGIN { die "You must define \$RT_HOME\n"
unless exists $ENV{RT_HOME} };
use lib "$ENV{RT_HOME}/lib";
use RT;
RT::LoadConfig();
RT::Init();
use RT::Interface::CLI qw(GetCurrentUser loc);
use RT::Tickets;
my $CurrentUser = GetCurrentUser();
die loc("No RT user found.\n") unless ($CurrentUser->Id);
die "We need exactly 2 Arguments, Name & Email\n" unless ($#ARGV==1);
my $UserName=shift @ARGV;
my $Email=shift @ARGV;
my $User = RT::User->new($CurrentUser);
my
($id,$Message)=$User->Create(Name=>$UserName,EmailAddress=>$Email,Privileged=>1,Password=>'changeme');
if ($id){
print $Message."\n";
}
else{
print"This is a error!\n$Message\n";
}
Its from jesse from an older training. its working fine for me.
Torsten
2007/3/17, Rick Phillips <rickp at suntech.net.au>:
>
> I have looked hard at the wiki and done extensive searching on the
> general web but can't seem to find any reference as to how to bulk
> upload users. In can dump the users directly into the database (I am
> assuming) but the passwords will need to be encrypted. I have a utility
> which will bulk encrypt passwords using md5sum. Is this the encryption
> method for RT? Will I need to update any other table other than
> RT-users? In our situation, it's a "closed shop" and the potential
> users are all known.
>
> I have been trying to make the MS active directory authentication work
> but have had to give up on that.
>
> I am using (via RPM install on Mandriva) version 3.4.5.
>
> Thanks in advance,
>
> Rick
>
> _______________________________________________
> http://lists.bestpractical.com/cgi-bin/mailman/listinfo/rt-users
>
> Community help: http://wiki.bestpractical.com
> Commercial support: sales at bestpractical.com
>
>
> Discover RT's hidden secrets with RT Essentials from O'Reilly Media.
> Buy a copy at http://rtbook.bestpractical.com
>
--
MFG
Torsten Brumm
http://www.torsten-brumm.de
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.bestpractical.com/pipermail/rt-users/attachments/20070319/c5f49e9b/attachment.htm>
More information about the rt-users
mailing list