Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a txt file with a list of servers. I'm looking for a script that I can run that will go out to all the servers on the list and return all users and groups in the local Administrators group. Does anyone know of an easy way to accomplish this? Thanks!

share|improve this question
up vote 1 down vote accepted

My answer on this question has a script that will do what you want. It parses all the groups / users on the list of computers fed to it and has some rudimentary capabilties to ignore users / groups you're not interested in.

share|improve this answer
all the examples i found on the net all used VBScript. its interesting that it seems to be the "choice" language for this kind of stuff. – djangofan Oct 29 '09 at 20:53
I use VBScript or JScript because they're more expressive than batch scripting and they're available "out of the box" on modern Windows installs (whereas PowerShell still isn't)... – Evan Anderson Oct 30 '09 at 1:49
Actually, Powershell is included in Windows 7 out of the box. – AndyM Nov 2 '09 at 16:33
I daresay that Windows 7 doesn't qualify as "most modern Windows installs" on October 30, 2009. I work with a lot more Windows Server 2003, Windows XP, and Windows Vista than I do Windows Server 2008 R2 and Windows 7. – Evan Anderson Nov 2 '09 at 17:13

You should use a powershell script. They have pre-made scripts on some sites.

share|improve this answer
You could use PowerShell but it's hardly a requirement. – John Gardeniers Oct 29 '09 at 1:31

There are a number of ways to do this. e.g. You could use psexec to run a script on each target machine. As for the script, here's a few you could start with.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.