|
Hobbyist Programmer
Join Date: Nov 2005
Posts: 172
Rep Power: 4 
|
Alright I'll go into more detail. When I have to do something more than 3 times with the basic setup just different variables I like to put it into a loop. When I go to create a GPO with the AD Users and Computers it's just to much work to be doing it over and over. So I'd like to where I can create the GPO with the command line. This is what I have:
dsadd ou "ou=New, dc=nwtraders, dc=test" -desc "This is the New Programmers Group"
dsadd group "cn=NewGRP, ou=Groups, dc=nwtraders, dc=test" -samid NewGRP -secgrp yes -scope g -desc "This is the New Programmers Group"
mkdir c:\shares\New
CACLS c:\shares\New /g "nwtraders\Domain Admins":F
Y
CACLS c:\shares\New /e /g "nwtraders\NewGRP":R
mkdir c:\shares\Newshared
CACLS c:\shares\Newshared /g "nwtraders\Domain Admins":F
Y
CACLS c:\shares\Newshared /e /g "nwtraders\NewGRP":R
net share New=c:\shares\New
net share Newshared=c:\shares\Newshared
dsadd user "cn=John_Smith,ou=New,dc=nwtraders,dc=test" -samid SmithJo -upn SmithJo@nwtraders.test -fn John -ln Smith -display John_Smith -pwd skyhawk -hmdir \SchoolTest\New\SmithJo\home\ -hmdrv h: -mustchpwd yes
dsmod group "cn=NewGRP, ou=Groups, dc=nwtraders, dc=test" -addmbr "cn=John_Smith,ou=New,dc=nwtraders,dc=test"
mkdir c:\shares\New\SmithJo\home
mkdir c:\shares\New\SmithJo\Tograde
CACLS c:\shares\New\SmithJo /g "nwtraders\Domain Admins":F
Y
CACLS c:\shares\New\SmithJo /e /g "nwtraders\SmithJo":C
CACLS c:\shares\New\SmithJo /e /r "nwtraders\NewGRP"
dsadd user "cn=Bob_Smith,ou=New,dc=nwtraders,dc=test" -samid SmithBo -upn SmithBo@nwtraders.test -fn Bob -ln Smith -display Bob_Smith -pwd skyhawk -hmdir \SchoolTest\New\SmithBo\home\ -hmdrv h: -mustchpwd yes
dsmod group "cn=NewGRP, ou=Groups, dc=nwtraders, dc=test" -addmbr "cn=Bob_Smith,ou=New,dc=nwtraders,dc=test"
mkdir c:\shares\New\SmithBo\home
mkdir c:\shares\New\SmithBo\Tograde
CACLS c:\shares\New\SmithBo /g "nwtraders\Domain Admins":F
Y
CACLS c:\shares\New\SmithBo /e /g "nwtraders\SmithBo":C
CACLS c:\shares\New\SmithBo /e /r "nwtraders\NewGRP"
dsadd user "cn=Jack_Johnson,ou=New,dc=nwtraders,dc=test" -samid JohnsonJa -upn JohnsonJa@nwtraders.test -fn Jack -ln Johnson -display Jack_Johnson -pwd skyhawk -hmdir \SchoolTest\New\JohnsonJa\home\ -hmdrv h: -mustchpwd yes
dsmod group "cn=NewGRP, ou=Groups, dc=nwtraders, dc=test" -addmbr "cn=Jack_Johnson,ou=New,dc=nwtraders,dc=test"
mkdir c:\shares\New\JohnsonJa\home
mkdir c:\shares\New\JohnsonJa\Tograde
CACLS c:\shares\New\JohnsonJa /g "nwtraders\Domain Admins":F
Y
CACLS c:\shares\New\JohnsonJa /e /g "nwtraders\JohnsonJa":C
CACLS c:\shares\New\JohnsonJa /e /r "nwtraders\NewGRP" That is generated from a program that just takes in the names of the users runs it through a loop then displays it. After the OU and Group is created is where I want to have the GPO created and configured. I can set this up right now to where you paste it into a command prompt or you can save it as a batch file and then it will be. I'm going to make it to where it's a regular GUI because the people that will be using this wont be the smartest bunch, Administrative assistants.
|