bsharath
asked on
Get all the administrator users from all machines in the list
Hi,
I need to get who is the administrator of the machine.I need to get from all the machines from the list.
Machine name and Users who have administrator priviledges.
Regards
Sharath
I need to get who is the administrator of the machine.I need to get from all the machines from the list.
Machine name and Users who have administrator priviledges.
Regards
Sharath
ASKER
I have tried with many machines.I get this error.
C:\Pstool>for /f %x in (c:\computers.txt) do psexec \\%x net localgroup administ
rators >> result.txt
C:\Pstool>psexec \\Dev-chen-mrd100 net localgroup administrators 1>>result.txt
PsExec v1.63 - Execute processes remotely
Copyright (C) 2001-2005 Mark Russinovich
Sysinternals - www.sysinternals.com
Error communicating with PsExec service on Dev-chen-mrd100:
The pipe has been ended.
C:\Pstool>psexec \\Dev-chen-srv401 net localgroup administrators 1>>result.txt
PsExec v1.63 - Execute processes remotely
Copyright (C) 2001-2005 Mark Russinovich
Sysinternals - www.sysinternals.com
PsExec could not start net:
Logon failure: unknown user name or bad password.
C:\Pstool>psexec \\Dev-chen-srv400 net localgroup administrators 1>>result.txt
PsExec v1.63 - Execute processes remotely
Copyright (C) 2001-2005 Mark Russinovich
Sysinternals - www.sysinternals.com
Couldn't access Dev-chen-srv400:
The trust relationship between this workstation and the primary domain failed.
C:\Pstool>for /f %x in (c:\computers.txt) do psexec \\%x net localgroup administ
rators >> result.txt
C:\Pstool>psexec \\Dev-chen-mrd100 net localgroup administrators 1>>result.txt
PsExec v1.63 - Execute processes remotely
Copyright (C) 2001-2005 Mark Russinovich
Sysinternals - www.sysinternals.com
Error communicating with PsExec service on Dev-chen-mrd100:
The pipe has been ended.
C:\Pstool>psexec \\Dev-chen-srv401 net localgroup administrators 1>>result.txt
PsExec v1.63 - Execute processes remotely
Copyright (C) 2001-2005 Mark Russinovich
Sysinternals - www.sysinternals.com
PsExec could not start net:
Logon failure: unknown user name or bad password.
C:\Pstool>psexec \\Dev-chen-srv400 net localgroup administrators 1>>result.txt
PsExec v1.63 - Execute processes remotely
Copyright (C) 2001-2005 Mark Russinovich
Sysinternals - www.sysinternals.com
Couldn't access Dev-chen-srv400:
The trust relationship between this workstation and the primary domain failed.
ASKER
Any help....
ASKER
I tryed this works but in the results file i am not able to know fo which machine the data is.
ASKER CERTIFIED SOLUTION
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
Now this script fits that question :)
for /f %x in (c:\computers.txt) do psexec \\%x net localgroup administrators >> result.txt
Regards