Old 3rd November 2009, 14:31
CMPJeff CMPJeff is offline
Junior Member
Join Date: Nov 2009
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default LDAP add User script


I've been trying to creat a user with the following script :


#This Script adds a LDAP USER With a Zarafa Account

rm /tmp/ldapadduser.ldiff


# Variables

echo dn: uid=$USERNAME,ou=Users,dc=company,dc=nl >> /tmp/ldapadduser.ldiff
echo objectClass: posixAccount >> /tmp/ldapadduser.ldiff
echo objectClass: top >> /tmp/ldapadduser.ldiff
echo objectClass: inetOrgPerson >> /tmp/ldapadduser.ldiff
echo objectClass: zarafa-user >> /tmp/ldapadduser.ldiff
echo objectClass: qmailUser >> /tmp/ldapadduser.ldiff
echo gidNumber: 65534 >> /tmp/ldapadduser.ldiff
echo loginShell: /none >> /tmp/ldapadduser.ldiff
echo givenName: $FNAME >> /tmp/ldapadduser.ldiff
echo sn: $LNAME >> /tmp/ldapadduser.ldiff
echo displayName: $FNAME $LNAME >> /tmp/ldapadduser.ldiff
echo uid: $USERNAME >> /tmp/ldapadduser.ldiff
echo homeDirectory: /none >> /tmp/ldapadduser.ldiff
echo mail: $EMAILADRESS >> /tmp/ldapadduser.ldiff
echo zarafaAccount: 1 >> /tmp/ldapadduser.ldiff
echo zarafaQuotaOverride: 0 >> /tmp/ldapadduser.ldiff
echo zarafaSharedStoreOnly: 0 >> /tmp/ldapadduser.ldiff
echo zarafaAdmin: 0 >> /tmp/ldapadduser.ldiff
echo zarafaQuotaHard: 1000 >> /tmp/ldapadduser.ldiff
echo zarafaQuotaSoft: 900 >> /tmp/ldapadduser.ldiff
echo zarafaQuotaWarn: 800 >> /tmp/ldapadduser.ldiff
echo cn: $LNAME $LNAME >> /tmp/ldapadduser.ldiff
echo uidNumber: 30266 >> /tmp/ldapadduser.ldiff

And after this script i perform a ldapadd to add the user...

BUT ! i have to have a unique uidNumber... Anyone ideas on how to do so ??

thnx in advance

Reply With Quote
Sponsored Links
Old 13th November 2009, 21:01
adient adient is offline
Junior Member
Join Date: Nov 2009
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts

I did not create this solution, but it is what we have implemented for a similar purpose and it is very easy and effective.

The basic idea is to have an objectClass of 'uidNext', which has one required attribute of uidNumber. To begin, you create an entry with this objectClass and your desired starting uidNumber.

You would check the uidNumber attribute of uidNext, delete the entry, then recreate the uidNext entry with uidNumber+1. Use the original uidNumber for your new user.

Read more about the implementation:
Reply With Quote


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Add user from command line the_saint Installation/Configuration 8 11th August 2008 15:26
Samba Ldap Problem ZenMatrix Server Operation 1 10th August 2008 08:02
Step 8: Add an LDAP user to the system Problem [Stuck] oalkatib HOWTO-Related Questions 21 19th May 2008 22:00
log files cruz Technical 3 15th May 2007 15:35
Ftp User Creation Script pushparaj Programming/Scripts 4 27th September 2006 21:15

All times are GMT +2. The time now is 22:19.

Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.