↑ Return to Dos Commands

Print this Page

Net localgroup

System Administration Commands Net localgroup

Local Commands

How to find all local administrators?

Command: Net localgroup administrators

How to add a user to local administrators group?

Command: Net localgroup administrators Mydomain\username /add

How to delete a user from local administrators group?

Command: Net localgroup administrators mydomain\username /delete

 

Remote Machines:

How to find all local administrators from remote machine.

Command: psexec \\servername Net Localgroup administrators

How to add a user to remote server  local administrators group?

Command: psexec \\servername Net localgroup administrators  mydomain\username /add

How to delete a user under local administrators group from remote machine ?

Command: psexec \\servername Net localgroup administrators mydomain\username /delete

 

Command to run above commands for a list of servers.

How to find all local administrators for a list of remote machines.

Command: for /f %i in (D:\MachineList.txt) do psexec \\%i Net Localgroup administrators

How to add a user on list of  remote server under  local administrators group?

Command: for /f %i in (D:\MachineList.txt) do psexec \\%i Net Localgroup administrators  mydomain\username /add

How to delete a user on list of  remote server under local administrators group ?

Command: for /f %i in (D:\MachineList.txt) do psexec \\%i Net Localgroup administrators mydomain\username /delete

 

 

Permanent link to this article: http://www.techxpress.in/dos-commands/net-localgroup/

Leave a Reply

Bookmark this page