Skip to main content

Posts

Showing posts from January, 2016

VB Script to List Local Administrators Membership

VB Script to List Local Administrators Membership

Script Credit : Brian Desmond

'==========================================================================
' 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…