Tool for finding who is a member of local Administrators group?

G

Guest

Does any one have a tool or know of a way to scan workstations in an
enterprise environment to find out who is a member of the local
administrators group on each of those workstations
 
G

Guest

I prefer WMI or ADSI scripting, but if you are not a scripter, you might try
the following command on the CMD prompt: net localgroup administrators

If you are a scripter, here is a WMI sample. Just cut the code below, and
paste it into Notepad, and then name it something like "Admin.vbs" Then
double-click on it. It will display all members in the group
"Administrators." You will note that a period indicates a the local machine,
so the script will always display a period in the query box as a default. If
you want to query a remote machine, specify a machine name in the query box
instead of a period, and the code will remotely retrieve all Administrator
group members from that machine. Obviously, you will need to script more to
log machines in an automated fashion. Hope this helps. - Vinson


' // Cut Below

On Error Resume Next

strComputer = inputbox("Enter the machine name: ","List All
Administrators",".")
Set objGroup = GetObject("WinNT://" & strComputer & "/Administrators")

For Each objUser In objGroup.Members
Wscript.Echo "Name: " & objUser.Name
Next

' // End Cut Here
 

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