[K12OSN] Customised smbldap-useradd-bulk script (quite long)

Brian Chivers brian at portsmouth-college.ac.uk
Fri Feb 4 15:34:55 UTC 2005


OK I've fixed the problem with LAM that I was having problems with earlier
this week on my snadbox system and it now works except it moans about some
of the user names I have used so I've decided to look at other options.

I've been looking at the smbldap-useradd-bulk script for the creation
ofusers and it almost fits the bill except for one thing, we use a
differenthome directories depending of what tutor group the student is in.
So forexample we have

/home_student/tutorgroups/101/e000000

where e000000 is the students unique enrollment number.

I've altered the bulk script to read a userinfo.start file that looks like
this

    firstname,surname,username3,513,/bin/false,/home_student/tutorgroup/,101
    firstname,surname,username4,513,/bin/false,/home_student/tutorgroup/,101
    firstname,surname,username5,513,/bin/false,/home_student/tutorgroup/,101

and the resulting username.finish looks like this

    #################################
    Fri Feb 4 15:19:00 2005

    firstname,surname,username3,513,coo22gra
    firstname,surname,username4,513,get25hoi
    firstname,surname,username5,513,naw44not

This allows me to specify the users default shell (which is different to
staff users) and home directory

If I do a slapcat this is the output I get for one of the users

    dn: uid=username5,ou=Users,dc=portsmouth-college,dc=ac,dc=uk
    objectClass: top
    objectClass: inetOrgPerson
    objectClass: posixAccount
    objectClass: shadowAccount
    objectClass: sambaSamAccount
    cn: firstname surname
    sn: username5
    uid: username5
    uidNumber: 1014
    gidNumber: 513
    homeDirectory: /home_student/tutorgroup/101/username5
    loginShell: /bin/false
    gecos: firstname surname
    description: firstname surname
    structuralObjectClass: inetOrgPerson
    entryUUID: d84d32a4-0b0b-1029-942f-93dd0faf8abf
    creatorsName: cn=Manager,dc=portsmouth-college,dc=ac,dc=uk
    createTimestamp: 20050204151902Z
    sambaLogonTime: 0
    sambaLogoffTime: 2147483647
    sambaKickoffTime: 2147483647
    sambaPwdCanChange: 0
    displayName: firstname surname
    sambaSID: S-1-5-21-1240284926-321800789-3025080556-3028
    sambaPrimaryGroupSID: S-1-5-21-1240284926-321800789-3025080556-513
    sambaLogonScript: startup.bat
    sambaProfilePath: \\TANGIER-PDC\profiles
    sambaHomePath: \\TANGIER-PDC\homes
    sambaHomeDrive: P:
    sambaLMPassword: 4F980DF14D4528FD417EAF50CFAC29C3
    sambaAcctFlags: [U]
    sambaNTPassword: 9EBFB1A4D317AC3590BE49A47EA6754D
    sambaPwdLastSet: 1107530342
    sambaPwdMustChange: 1139066342
    userPassword:: e1NTSEF9dGQ3b3BWSmUxWlVjTWJzZTZuSUdFQVQwQm85WVlTNVo=
    entryCSN: 20050204151902Z#000007#00#000000
    modifiersName: cn=Manager,dc=portsmouth-college,dc=ac,dc=uk
    modifyTimestamp: 20050204151902Z


And pdbedit -Lv username5 gives

    Unix username: username5
    NT username: username5
    Account Flags: [U ]
    User SID: S-1-5-21-1240284926-321800789-3025080556-3028
    Primary Group SID: S-1-5-21-1240284926-321800789-3025080556-513
    Full Name: firstname surname
    Home Directory: \\TANGIER-PDC\homes
    HomeDir Drive: P:
    Logon Script: startup.bat
    Profile Path: \\TANGIER-PDC\profiles
    Domain: TANGIER-PDC
    Account desc: firstname surname
    Workstations:
    Munged dial:
    Logon time: 0
    Logoff time: Tue, 19 Jan 2038 03:14:07 GMT
    Kickoff time: Tue, 19 Jan 2038 03:14:07 GMT
    Password last set: Fri, 04 Feb 2005 15:19:02 GMT
    Password can change: 0
    Password must change: Sat, 04 Feb 2006 15:19:02 GMT
    Last bad password : 0
    Bad password count : 0
    Logon hours : FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF

Does all this look correct ??

I've attached the altered script to this email

Thanks
Brian Chivers
Portsmouth College

---------------------------------------------------------------
    The views expressed here are my own and not necessarily 
                the views of Portsmouth College             
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smbldap-useradd-bulk-custom-homes
Type: application/octet-stream
Size: 16366 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/k12osn/attachments/20050204/81c4b20b/attachment.obj>


More information about the K12OSN mailing list