Brian
asked on
How to script adding global groups to local groups on multiple computers
Hello everyone.
I'm not scripting expert like most of you in here and thus could use your help.
I'm trying to add a domain global group and several other user accounts to the the local administrators group on several servers. I know how to add one group to one server using the command below.
net localgroup administrators domain\group /add
This works great. My question is how would I word a script/batch file to do that plus several other domain groups and users and then be able to apply that to a list of servers?
Let me know if you need further explanation. I would prefer a solution using some form of script and not group policy.
Thanks,
Brian
I'm not scripting expert like most of you in here and thus could use your help.
I'm trying to add a domain global group and several other user accounts to the the local administrators group on several servers. I know how to add one group to one server using the command below.
net localgroup administrators domain\group /add
This works great. My question is how would I word a script/batch file to do that plus several other domain groups and users and then be able to apply that to a list of servers?
Let me know if you need further explanation. I would prefer a solution using some form of script and not group policy.
Thanks,
Brian
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
oops...I should read better...you just want to run the script to apply it remotely to a list of servers, right?
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Thanks for the points...glad the script worked for you.
But like Eagle6990 said, so the script would look something like:
@echo off
net localgroup administrators domain\group /add
net localgroup administrators domain\username /add
net localgroup administrators domain\group#2 /add
net localgroup administrators domain\username#2 /add
Note like Eage said, you have to apply it to the Compuer Configuration section in GP, not the User configuration.