+ Post New Thread
Results 1 to 9 of 9
How do you do....it? Thread, Active Directory-Script for Creating Bulk Users in Technical; Hi I am not very experienced in Active Directory and will appreciate if anyone can help me to do the ...
  1. #1
    calapso's Avatar
    Join Date
    May 2007
    Posts
    12
    Thank Post
    0
    Thanked 3 Times in 2 Posts
    Rep Power
    16

    Active Directory-Script for Creating Bulk Users

    Hi

    I am not very experienced in Active Directory and will appreciate if anyone can help me to do the following task:

    a) Create bulk users ( users will be P1 to P1000 for pupils and T1 to T100 for teachers.

    b) Create their home folders .

    C) Share those folders.

    d) Set the permissions on the folders

    Does anyone have a script that will automate this ?

    Many thanks!

  2. #2
    mark's Avatar
    Join Date
    Jun 2005
    Posts
    3,987
    Thank Post
    275
    Thanked 52 Times in 46 Posts
    Blog Entries
    2
    Rep Power
    48

    Re: Active Directory-Script for Creating Bulk Users


  3. #3

    Join Date
    Sep 2006
    Location
    Essex
    Posts
    786
    Thank Post
    1
    Thanked 34 Times in 32 Posts
    Rep Power
    24

    Re: Active Directory-Script for Creating Bulk Users

    Code:
    for /f "Tokens=1,2,3,4,5,6,7,8 Delims=," %%a in (newusers.csv) do 
    
    (dsadd user "cn=%%a,ou=%%b,ou=%%g,dc=evolvedit,dc=com" -samid %%a -upn %%a@yourdomain.com -fn %%d -ln %%e -display "%%d %%e" -hmdir "%%f%%a\My Documents" -hmdrv h: -pwd "ChangeMe" -canchpwd yes -pwdneverexpires no -memberof "cn=%%g,ou=%%g,dc=yourdomain,dc=com"
    
    md "D:\User Home Folders\%%g\%%b\%%a\My Documents"
    cacls "D:\User Home Folders\%%g\%%b\%%a" /T /G "%%a":F /e
    cacls "D:\User Home Folders\%%g\%%b\%%a" /T /G Administrators:F /e
    cacls "D:\User Home Folders\%%g\%%b\%%a" /T /E /R Everyone
    cacls "D:\User Home Folders\%%g\%%b\%%a" /T /E /R Users
    
    echo added user %%a >> userlog.txt
    
    )
    I use something like this. This script reads the vaiables from a CSV file (each user on a separate line)

    DSADD adds the user account to active directory, sets the password, and places the user account in the correct OU

    You can specify other options using DSADD see this artical.

    http://technet2.microsoft.com/window....mspx?mfr=true

    The home folder is created below a shared home folder for staff and students respectively so you don’t have to worry about sharing or setting share permissions.

    CACLS sets the ACL information on the home folder.

  4. #4
    ICT_GUY's Avatar
    Join Date
    Feb 2007
    Location
    Weymouth
    Posts
    2,276
    Thank Post
    689
    Thanked 283 Times in 204 Posts
    Rep Power
    106

    Re: Active Directory-Script for Creating Bulk Users

    csvde and excel are your friends, once you have got you head around whats needed. I will be doing this again in september for the third time, and this time I will be writting the idiots guide for myself to use the year after.

    My cheat sheet (not my own work)

  5. #5
    calapso's Avatar
    Join Date
    May 2007
    Posts
    12
    Thank Post
    0
    Thanked 3 Times in 2 Posts
    Rep Power
    16

    Re: Active Directory-Script for Creating Bulk Users

    Hi djm968

    Unable to send you a PM as I am getting some smtp error message.

    Anyway with regards to the password I would like it to be left blank.

    Thanks and look forward to your input.

    Regards

    Calapso

  6. #6

    Join Date
    Feb 2006
    Posts
    1,187
    Thank Post
    0
    Thanked 1 Time in 1 Post
    Rep Power
    0

    Re: Active Directory-Script for Creating Bulk Users

    Quote Originally Posted by calapso
    Anyway with regards to the password I would like it to be left blank.
    Are you sure about that? It is very insecure.

  7. #7
    calapso's Avatar
    Join Date
    May 2007
    Posts
    12
    Thank Post
    0
    Thanked 3 Times in 2 Posts
    Rep Power
    16

    Re: Active Directory-Script for Creating Bulk Users

    Hi Networkgeezer

    I agree with you about security. I work in a primary school and this is for primary school kids in Key Stage 1 who have trouble remembering passwords hence no password required.

    For Key Stage 2 I will require passwords though.

    Thanks for your input and any help on this subject would be welcome!...I am new to this!

    Regards

    Calapso

  8. #8
    calapso's Avatar
    Join Date
    May 2007
    Posts
    12
    Thank Post
    0
    Thanked 3 Times in 2 Posts
    Rep Power
    16

    Re: Active Directory-Script for Creating Bulk Users

    Quote Originally Posted by djm968
    Code:
    for /f "Tokens=1,2,3,4,5,6,7,8 Delims=," %%a in (newusers.csv) do 
    
    (dsadd user "cn=%%a,ou=%%b,ou=%%g,dc=evolvedit,dc=com" -samid %%a -upn %%a@yourdomain.com -fn %%d -ln %%e -display "%%d %%e" -hmdir "%%f%%a\My Documents" -hmdrv h: -pwd "ChangeMe" -canchpwd yes -pwdneverexpires no -memberof "cn=%%g,ou=%%g,dc=yourdomain,dc=com"
    
    md "D:\User Home Folders\%%g\%%b\%%a\My Documents"
    cacls "D:\User Home Folders\%%g\%%b\%%a" /T /G "%%a":F /e
    cacls "D:\User Home Folders\%%g\%%b\%%a" /T /G Administrators:F /e
    cacls "D:\User Home Folders\%%g\%%b\%%a" /T /E /R Everyone
    cacls "D:\User Home Folders\%%g\%%b\%%a" /T /E /R Users
    
    echo added user %%a >> userlog.txt
    
    )
    I use something like this. This script reads the vaiables from a CSV file (each user on a separate line)

    DSADD adds the user account to active directory, sets the password, and places the user account in the correct OU

    You can specify other options using DSADD see this artical.

    http://technet2.microsoft.com/window....mspx?mfr=true

    The home folder is created below a shared home folder for staff and students respectively so you don’t have to worry about sharing or setting share permissions.

    CACLS sets the ACL information on the home folder.
    Hi

    I am struggling with the format of the CSV file. How do the viriables %%a , %%b , %%g etc tie in with the csv file format? I will appreciate if anyone can show a sample line that would tie in with the above code.

    I tried technet articles but still struggling.

    I have a new server to build next week so a speedy response would be much appreciated.

    Many thanks.

  9. #9
    ANB
    ANB is offline

    Join Date
    Jan 2009
    Location
    Rotherham
    Posts
    14
    Thank Post
    0
    Thanked 8 Times in 1 Post
    Rep Power
    14
    Removed.
    Last edited by ANB; 15th January 2009 at 08:05 AM. Reason: Advertisement removed.



SHARE:
+ Post New Thread

Similar Threads

  1. Active Directory - Single and Bulk User creation and FREE!!
    By siuko in forum How do you do....it?
    Replies: 39
    Last Post: 20th June 2012, 12:29 PM
  2. Cannot create users in Active Directory
    By WithoutMotive in forum Windows
    Replies: 17
    Last Post: 6th February 2009, 12:20 PM
  3. Importing new users into Active Directory
    By Mr_M_Cox in forum How do you do....it?
    Replies: 16
    Last Post: 4th November 2008, 12:36 PM
  4. Replies: 2
    Last Post: 28th November 2007, 05:40 PM
  5. script for active directory
    By chalkwellstu in forum Scripts
    Replies: 8
    Last Post: 24th September 2007, 02:53 PM

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •