Re: List users in local administrators group on remote machine

Tech-Archive recommends: Fix windows errors by optimizing your registry



Pegasus,

Thank you very much for your quick reply. I am new at this so can you give
me a short example of the command to use on remote machine with psexec.exe?
So if I understand I keep the PSEXEC.EXE on my machine and create a .bat file
and copy it to the remote machines and execute with PSEXEC.EXE.

Thanks,
Nick

"Pegasus (MVP)" wrote:


"Nick" <Nick@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:0E9F1D7C-E802-4E55-9935-AEF28B15E8EC@xxxxxxxxxxxxxxxx
Hi,

I am looking to manage all desktops on our network with regard to the
local
administrators group. There are several things I am looking to
accomplish:

1. list all users (domain and local) in local administrators group on
multiple remote computers
2. remove user from local administrators group on remote computer
3. add domain user account to local administrators group on remote
computer
4. remove local user account from remote computer
5. Report on current members of the local administrators group.

Any assistance you can provide would be greatly appreciated.
We have .Net software if that would be the best way to tackle this but I
am
not sure which way to go.

Thanks!
Nick

You could do the whole lot with the inbuilt net.exe command:
1. net localgroup administrators
2. net localgroup administrators nick /delete
3. net localgroup administrators Domainname\nick /add
4. net user %ComputerName%\nick /delete
5. Same as 1. above.

To run the commands on a remote computer, put them into a batch file, then
invoke the batch file with psexec.exe (www.sysinternals.com) under your
domain admin account.



.



Relevant Pages

  • Re: List users in local administrators group on remote machine
    ... simpler than copying it to all machines. ... list all users in local administrators group on ... remove user from local administrators group on remote computer ... net localgroup administrators nick /delete ...
    (microsoft.public.windows.server.scripting)
  • Re: List users in local administrators group on remote machine
    ... list all users in local administrators group on ... remove user from local administrators group on remote computer ... net localgroup administrators nick /delete ... To run the commands on a remote computer, put them into a batch file, ...
    (microsoft.public.windows.server.scripting)
  • Re: List users in local administrators group on remote machine
    ... list all users in local administrators group on ... remove user from local administrators group on remote computer ... net localgroup administrators nick /delete ...
    (microsoft.public.windows.server.scripting)
  • Re: Scripting questions
    ... which is a member of the local Administrators group on computer "WST101". ... Bind to the local administrators group on the remote computer and use the ...
    (microsoft.public.windows.server.scripting)
  • Re: Scripting questions
    ... list all users in local administrators group on remote computer ... For example, JUser could be a member of domain group "Sales", which is a member of domain group "West", which is a member of the local Administrators group on computer "WST101". ... Bind to the local administrators group on the remote computer and use the Remove method of the group object. ...
    (microsoft.public.windows.server.scripting)