Page 1 of 1
Adding 1000 new users with full information
Posted: Sat May 20, 2006 6:26 pm
by Nexis
Are there people who have scripts to do omaddu command. Where you can fill in all the option username, mail adres, display adres, adresbook info + group informatio, password,...
So that I can prepare this in a file and at it in batch?
Thanks Koen
Posted: Tue May 23, 2006 7:52 am
by Valerion
Some of that info is actually in the SYSTEM directory and not the user's information. Check out the man pages for omaddu and omaddent.
Basically the following is settable via omaddu (output from omshowu):
Authentication ID: sxadmin
User Name : Scalix Administrator /CN=Scalix Administrator
MailNode : <removed>
Internet Address : <removed>
System Login : sxadmin
Password : set
Admin Capabilities : YES
Mailbox Admin Capabilities : NO
Language : ENGLISH
Mail Account: Unlocked
Receipt of mail : ENABLED
Service level : 0
Excluded from Tidying : NO
User Class : Full
The other information will need to be populated into the directory with ommodent AFTER ommodu has been run.
I suggest you create a user and populate all the attributes, then do
omsearch -e 'S=lastname/G=firstname' and check the output, it will show you the attributes in use.
Here is an example:
S=Lastname/G=Firstname/OU1=mailnode/CN=Displayname/CNTRY=Country Code/PHONE-1=Work Phone/MOBILE-PHONE=Mobile Number/FAX=Fax Number/STREET-ADDRESS=Street Address/L=City/STATE-OR-PROVINCE=My Province/POSTAL-CODE=My Postal Code/HOME-PHONE=Home Number
To change the work phone and mobile numbers do:
ommodent -e 'S=lastname/G=firstname/OU1=mailnode-1/OU2=mailnode-2' -n 'PHONE-1=1234567890/MOBILE-PHONE=0987654321'
You need to specify enough parameters to the '-e' to uniquely identify the user.
Posted: Tue May 23, 2006 8:25 am
by hydrospace
where you get the data of the users from? I guess you will provide a source file with each user and its properties. Then a script should run tru it and execute the omaddu command? Am I right? Or do you use Active Directory or similar?
--Stefan
Posted: Tue May 23, 2006 8:29 am
by Valerion
Yes, you'll need a source of information. If you've got it in a file, you can use a script to generate the omaddu and ommodent commands. If you have got it in a LDAP tree (eg. MS AD), then you can set up a omldapsync agreement to get the information from there.
Posted: Sat May 27, 2006 5:52 pm
by Nexis
It is a dump from an SAP database. Normally I get all that information in a excell file. Can you give a example how to automate the omaddu and add all addition info for a few users?
Thanks Koen
Posted: Mon May 29, 2006 9:01 am
by Valerion
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.
Posted: Mon May 29, 2006 10:59 am
by Nexis
I tryed the omloadfile command, but I can't find the syntacs to add Firstname, Lastname, Displayname, Email address, Home Phone
Posted: Tue May 30, 2006 4:07 am
by Valerion
You may want to look at the following threads:
http://www.scalix.com/community/viewtop ... omloadfile
http://www.scalix.com/community/viewtop ... omloadfile
http://www.scalix.com/community/viewtop ... omloadfile
Also, there's a document on the Knowledge Base titled Advanced Directory and Mailbox Provisioning that will assist you.