Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save stasgm/d129e9171d3f870b5e51 to your computer and use it in GitHub Desktop.
Save stasgm/d129e9171d3f870b5e51 to your computer and use it in GitHub Desktop.
Set objWsNet = CreateObject("WScript.Network")
strComputer = objWsNet.ComputerName
Set objWsNet = Nothing
Set objGroup = GetObject("WinNT://" & strComputer & "/Administrators")
For Each objUser In objGroup.Members
If StrComp(objUser.Class, "user", vbTextCompare) = 0 Then strList = strList & objUser.Name & vbNewLine
Next
MsgBox strList
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment