Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie

Aufit Admin Rights...

Options
  • 15-03-2010 6:12pm
    #1
    Registered Users Posts: 4,331 ✭✭✭


    Anyone know of any tools (windows or otherwise) which can be used to audit 350 PC's to see who has admin rights to the local machine?


Comments

  • Registered Users Posts: 314 ✭✭Alzar


    Something like this VB Script?

    http://briandesmond.com/blog/script-to-collect-local-administrators-membership-from-list-of-machines/

    Remember to comment out or delete the lines beginning with WScript.Echo, otherwise there is a load of clicking to do on the pop-ups that appear.


    '==========================================================================
    ' NAME: Dump Local Administrators Membership
    '
    ' AUTHOR: Brian Desmond,
    ' DATE : 4/16/2007
    '==========================================================================

    Option Explicit
    Const LogFile = "LocalAdmins.log"
    Const resultFile = "LocalAdministratorsMembership.csv"
    Const inputFile = "c:\scripts\workstations.txt"

    Dim fso
    Set fso = CreateObject("Scripting.FileSystemObject")
    Dim shl
    Set shl = WScript.CreateObject("WScript.Shell")
    Dim fil
    Set fil = fso.OpenTextFile(inputFile)
    Dim results
    Set results = fso.CreateTextFile(resultFile, True)
    WriteToLog "Beginning Pass of " & inputFile & " at " & Now()
    WScript.Echo "Beginning Pass of " & inputFile & " at " & Now()
    'On Error Resume Next
    Dim grp
    Dim line
    Dim exec
    Dim pingResults
    Dim member
    While Not fil.AtEndOfStream
    line = fil.ReadLine

    Set exec = shl.Exec("ping -n 2 -w 1000 " & line)
    pingResults = LCase(exec.StdOut.ReadAll)

    If InStr(pingResults, "reply from") Then
    WriteToLog line & " responded to ping"
    WScript.Echo line & " responded to ping"

    'On Error Resume Next
    Set grp = GetObject("WinNT://" & line & "/Administrators")

    WScript.Echo line & ", Administrators"
    results.WriteLine line & ",Administrators,"

    For Each member In grp.Members
    WScript.Echo "Administrators: " & member.Name
    WriteToLog line & ": Administrators - " & member.Name
    results.WriteLine ",," & member.Name
    Next
    Else
    WriteToLog line & " did not respond to ping"
    WScript.Echo line & " did not respond to ping"
    End If
    Wend
    results.Close
    Sub WriteToLog(LogData)
    On Error Resume Next
    Dim fil
    '8 = ForAppending
    Set fil = fso.OpenTextFile(LogFile, 8, True)

    fil.WriteLine(LogData)
    fil.Close
    Set fil = Nothing
    End Sub
    '==========================================================================


    Al.


Advertisement