'==========================================================================
'
'
' NAME: <ListClassMethods.vbs>
'
' AUTHOR: Ed Wilson , MS
' DATE  : 4/19/2006
' VER		: 1.0
' COMMENT: <Connects to a WMI class and lists all the properties of the class>
'1.Properties_ returns a SWbemMethodSet object -- a collection
'2.It has a count property that tells how many items are in it.
'3.By connecting directly to the class, we return a SWbemObjectEx object ...
'4.Not a the swbemservices object normally returned by the moniker.
'==========================================================================

Option Explicit 
'On Error Resume Next
dim strComputer		'Name Of target computer
dim wmiNS					'WMI Namespace that contains class
dim wmiQuery			'Simply the name of the class
dim objWMIService	'Connection to WMI Namespace AND Class
dim objItem				'Item in the collection of properties

strComputer = "."
wmiNS = "\root\cimv2"
wmiQuery = ":win32_service"
Set objWMIService = GetObject("winmgmts:\\" & strComputer & _
		wmiNS & wmiQuery)

WScript.Echo wmiQuery & vbTab & " has " & _
		objWMIService.Methods_.count & " Methods"

For Each objItem in objWMIService.Methods_
    Wscript.Echo "Method: " & objItem.name
Next