Want to determine local administrators on multiple servers

Posted on 2006-03-20
Last Modified: 2009-12-16
This could probably be scripted if there is not a tool out there already for this but I need to determine memebers of the local Administrators group on about 150+ servers.  Other than manually going to each server and checking the Administrators group, can anyone think of an easy way to input a list of server names and get a CSV (or the like) out put of the server name and all members of the Administrators group?  Thanks!
Question by:dcoluzzi
    1 Comment
    LVL 4

    Accepted Solution

    The following script will work for you. Save the script to a file (for example adminmembers.vbs) and run. It will take the input from a text file "Computers.txt". Put all your computer names in this file with one name in each line. The script will walk through the text file to find computernames and then connect to them and find the members of Administrators group and put them in a csv file.

    '-----------Script starts here-------------------------------
    on error resume next
    const ForReading = 1
    const ForWriting = 2
    const ForAppending = 8

    Set oFS = CreateObject("Scripting.FileSystemObject")
    Set oTS = oFS.OpenTextFile("computers.txt",ForReading)

    Set ws = CreateObject ("Scripting.FileSystemObject")
    Set w = ws.OpenTextFile (".\Admin Members.csv", ForAppending, True)

    w.WriteLine "Information Collection started at " & now
    Do Until oTS.AtEndOfStream
    sComputer = oTS.ReadLine
      set Group = GetObject("WinNT://" + sComputer + "/Administrators,group")
      For Each Member in Group.Members
          mem = Member.adspath
            w.writeline sComputer & "," & right(mem,len(mem)-8) & "," & Member.class
    wscript.echo "Done!"

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    How your wiki can always stay up-to-date

    Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
    - Increase transparency
    - Onboard new hires faster
    - Access from mobile/offline

    It is a known fact that servers reach the end of their lives. Some get there quicker than others, based on age, manufacturer, usage and several other factors. However, if your organization has spent time deploying Microsoft's Active Directory server…
    I guess it is not common knowledge to most Wintel engineers/administrators: If you have an SNMP-based monitoring system in your environment (and it's common to have SNMP or Syslog) it's reasonably easy to enable monitoring of the Windows Event logs,…
    Hi everyone! This is Experts Exchange customer support.  This quick video will show you how to change your primary email address.  If you have any questions, then please Write a Comment below!
    Internet Business Fax to Email Made Easy - With eFax Corporate (, you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…

    779 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    15 Experts available now in Live!

    Get 1:1 Help Now