Add a user to Local Admin group on All machines.
Scenario: You need to add a user (test1) to local
Administrators group on all computer. How do you achieve this??? no no...you're
wrong here - don't need to use VBScript or something like that simply use
PSEXEC to accomplish this! - intersting!
Here it is:
psexec.exe net localgroup administrators
test.local\test /add -@server.txt
Isn't simple as pie?
-@server.txt - This
file includes the list of servers to be processed by psexec to run the Net
Localgroup Administrators test.local\test /add command.
net localgroup - This command directs NBT API to execute a
command using Windows Low-level sub-system. You should use Net Group for Global
security group if you're gonna add to Global Security Group.