by Bart Jonkman (20 Submissions)
Category: Miscellaneous
Compatability: Visual Basic 5.0
Difficulty: Unknown Difficulty
Originally Published: Wed 19th February 2003
Date Added: Mon 8th February 2021
Rating: (1 Votes)
WMI sample showing how to list group info and group membership of a (remote) computer, using WMI class Win32_Group.
' This function lists group info and group membership of a (remote) computer.
' Goto http://www.activxperts.com/activmonitor and click on WMI Samples
' for more samples
Sub ListGroups( strComputer )
Dim objWMIService, colItems
Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")
Set colItems = objWMIService.ExecQuery("Select * from Win32_Group",,48)
For Each objItem in colItems
Wscript.Echo "Caption: " & objItem.Caption
Wscript.Echo "Description: " & objItem.Description
Wscript.Echo "Domain: " & objItem.Domain
Wscript.Echo "InstallDate: " & objItem.InstallDate
Wscript.Echo "Name: " & objItem.Name
Wscript.Echo "SID: " & objItem.SID
Wscript.Echo "SIDType: " & objItem.SIDType
Wscript.Echo "Status: " & objItem.Status
Next
End Sub
' Main
Dim strComputer
Do
strComputer = inputbox( "Please enter a computername or . for local computer", "Input" )
Loop until strComputer <> ""
ListGroups( strComputer )
WScript.Echo( vbCrlf & "For more samples, goto http://www.activxperts.com/activmonitor and click" )
WScript.Echo( "on WMI samples" )
No comments have been posted about WMI sample showing how to list group info and group membership of a (remote) computer, using WMI cl. Why not be the first to post a comment about WMI sample showing how to list group info and group membership of a (remote) computer, using WMI cl.