Need a list of Administrators on many different Servers

Hi All,

I was recently tasked with determining who belongs to the Administrator Group on a large number of Servers on a single domain.  I was hoping that someone might know of a batch script or a psexec command that would run through a list composed of Server Names and output just the Administrator accounts from those Servers into some kind of File.  Any idea's?
RyanMyers83Asked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Justin EllenbeckerIT DirectorCommented:
Put all of the computers you want to check one perline in the text file specified by the path and then specify the results file and also you domain name.  Run the script and the results will be output to the file.
Set oFS = CreateObject("Scripting.FileSystemObject")
ResultFile = "C:\vbjunk\Results.txt"
Set results = oFS.OpenTextFile(ResultFile, 2, True)
srcFile = "C:\vbjunk\Machines.txt"
Domain = "your domain"
Set oFile = oFS.OpenTextFile(srcFile, 1, False)
Do Until oFile.AtEndOfStream
	strComputer = oFile.ReadLine
	results.WriteLine(strComputer)
	Set objGroup = GetObject("WinNT://" & strComputer & "/Administrators,group")
	For Each user In objGroup.Members
		results.WriteLine(vbTab & User.name)
	Next
	results.WriteLine
Loop

Open in new window

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
RyanMyers83Author Commented:
Works beautifully and as directed.  Thanks much!
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Windows Batch

From novice to tech pro — start learning today.