Adding Multiple users using CLI (A quick and Dirty way to get it done.)

Some of you longtime RT users may have already done this but I just
thought I would post this to the list.

As I am new to RT and migrating from our current system (Keystone.
Great system but no support) I had the daunting task of assigning users.
I looked through the Wiki and manual and couldn’t find an easy way to do
this.(Maybe I didn’t ask the right question?) I did find a Perl script
someone wrote but that meant I had to learn that script and see what I
had to do to change it to work under my conditions. In our case I just
wanted to create unprivileged accounts that can add tickets to our
system. The one stable thing in our setup is user’s email address.
These accounts are for the office they hold so I now had a constant that
doesn’t change as the actual person changes in that job.

I started reading the RT Essentials CLI Section and saw that you can
create a user from the command line by doing:

rt create -t user set name=username

So I could type this once, arrow up to recall the line and change a
small part of the username and ht enter. That is still too tedious and
monotonous for me. And where did I leave off. Keeping track is a
nightmare for that. So if a command line works why can’t I just create a
shell script (in your favorite shell) with the lines for each user.
Since each position is the same at each school with just a school
designator being the difference I created a line for each of the seven
offices at each school and then using the search and replace option in
vi I had a script that would create all 140+ users.
Next all I did was run the script and the users were created.

Then to add the password and other information common to the users I
again used the search and replace feature in vi to change what was there
while changing the create -t user to edit user/username. Although I
spent about 20 minutes creating this script and making changes for the
different fields it would have taken me at least a day to do this
through the Web Interface or even using the bash shell’s history
command. Keystroke wise it save a ton of time.

Sometimes we tend to look for a fancy fix when using a few common tools
will get the job done.

John J. Boris, Sr.
JEN-A-SyS Administrator
Archdiocese of Philadelphia
222 North 17th Street

“Remember! That light at the end of the tunnel
Just might be the headlight of an oncoming train!”