calapso Posted June 6, 2007 Posted June 6, 2007 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!
MkII Posted June 6, 2007 Posted June 6, 2007 a quick search brings up these previous recommendations: http://edugeek.net/index.php?name=Forums&file=viewtopic&t=134&highlight=bulk+user+creation http://edugeek.net/index.php?name=Forums&file=viewtopic&t=4020&highlight=bulk+user+creation http://edugeek.net/index.php?name=Forums&file=viewtopic&t=2600&highlight=bulk+user+creation
djm968 Posted June 6, 2007 Posted June 6, 2007 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 %%[email protected] -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/windowsserver/en/library/8d37ecb0-ac28-4e05-aa05-da82dc36b54b1033.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.
ICT_GUY Posted June 6, 2007 Posted June 6, 2007 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)
calapso Posted June 15, 2007 Author Posted June 15, 2007 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
NetworkGeezer Posted June 15, 2007 Posted June 15, 2007 Anyway with regards to the password I would like it to be left blank. Are you sure about that? It is very insecure.
calapso Posted June 16, 2007 Author Posted June 16, 2007 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
calapso Posted June 28, 2007 Author Posted June 28, 2007 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 %%[email protected] -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/windowsserver/en/library/8d37ecb0-ac28-4e05-aa05-da82dc36b54b1033.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.
ANB Posted January 14, 2009 Posted January 14, 2009 (edited) Removed. Edited January 15, 2009 by ANB Advertisement removed.
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now