Well, if you've got it in a CSV file, eg.
Code: Select all
Firstname, Lastname, Displayname, Email address, Home Phone
You can then do something like the following perl code:
Code: Select all
open INFILE "users.csv";
open OUTFILE ">usermod.sh";
while (<INFILE>) {
($first, $last, $dn, $email, $homephone) = split (",");
$last ~= s/ /_/;
print OUTFILE "/opt/scalix/bin/omaddu -n '$first $last/CN=$dn/IA=$email'\n";
print OUTFILE "/opt/scalix/bin/ommodent -e 'S=$last/G=$first/HOME-PHONE=$homephone'\n";
print OUTFILE "\n";
}
close OUTFILE;
close INFILE;
Please note that this is not tested code, just a snippet to give you some insight into how I would do it. It needs more things (like checks for empty values). You can also use the DBI module in perl to extract the info directly from the database. I like to pre-generate the commands, because then I can do a QC on the results myself (is there a user with incorrect info, or which I translated incorrectly?)
You can also use omloadfile from the Admin Resource Kit in your download media.