Local user added to local group on all computers

J

jayloveroni

I saw a post to add domain users to a domain group:

for /f %q in (addthesenames.txt) do (net group groupname %
q /add /domain)

But I want to write a script that will pull computernames
from a text file, and add a local user from said computers
to the said computers' Administrators group. All the
computers have the same local user.

Thanks in advance.

jjs
 
W

Walter Schulz

for /f %q in (addthesenames.txt) do (net group groupname %
q /add /domain)

But I want to write a script that will pull computernames
from a text file, and add a local user from said computers
to the said computers' Administrators group. All the
computers have the same local user.

for /f %q in (addthesecomputers.txt) do psexec \\%q net localgroup
administrators username /add

PSEXEC will be found in PSTOOLS from www.sysinternals.com

Computers must be up and running server service, which is default
configuration. The command must be executed by a user with admin
rights on the target computers.

Ciao, Walter
 
J

jayloveroni

Thanks,

I will give it a try.

jjs
-----Original Message-----

for /f %q in (addthesecomputers.txt) do psexec \\%q net localgroup
administrators username /add

PSEXEC will be found in PSTOOLS from www.sysinternals.com

Computers must be up and running server service, which is default
configuration. The command must be executed by a user with admin
rights on the target computers.

Ciao, Walter
.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top