[rt-users] Re: Advice for new RT3 user - Strategy/Scripts for creating/importing multiple users
David Z Maze
dmaze at cag.lcs.mit.edu
Mon May 19 15:12:29 EDT 2003
Roger J Thien <rthien at pacific.net.sg> writes:
> I'm really new to RT3 and have just managed to get it working. I'm
> also a beginner to Perl and any kind assistance is much appreciated.
>
> Is there some script out there that allows one to create users from
> the commandline? Or even better, a Perl script that parses a
> text-file in say CSV format and automagically create users in the RT3
> DB?
I use the attached Perl script to create users in RT at my site. It
works by asking the system password database for information about the
user (using the perl 'getpwnam' or 'getpwuid' call), and then getting
an RT::User object and calling its Create method with the correct
fields extracted from the password information. 'perldoc RT::User'
and 'perldoc RT::User_Overlay' will give you a listing of all of the
possible fields, though it doesn't say a whole lot about what they
mean.
It probably wouldn't be hard to extend this to read in a CSV file, but
that does involve learning enough Perl to be useful. :-)
(Be careful trying to use this script without editing it: it creates
'user at cag.lcs.mit.edu', which is probably wrong for you.)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: rtadduser
Type: application/x-perl
Size: 651 bytes
Desc: not available
URL: <http://lists.bestpractical.com/pipermail/rt-users/attachments/20030519/9c8af16c/attachment.bin>
-------------- next part --------------
--
David Z. Maze dmaze at cag.lcs.mit.edu
Research Scientist http://www.mit.edu/~dmaze/
MIT LCS Computer Architecture Group http://www.cag.lcs.mit.edu/commit/
More information about the rt-users
mailing list