List members of the Administrators group on the local computer.

Visual Basic
Edit|Remove
Set objNetwork = CreateObject("WScript.Network")
strComputer = objNetwork.ComputerName
strGroup = "Administrators"
WScript.Echo "Computer: " & strComputer
Set objGroup = GetObject("WinNT://" & strComputer & "/" & strGroup & ",group")
WScript.Echo "  Administrators group members:"
For Each objMember In objGroup.Members
  WScript.Echo "    " & objMember.Name
Next