I'm trying to follow the guides for accessing IIS 6 using WMI but I'm having trouble working out how to translate the Get method of SWbemServices as Get-WmiObject doesn't seem to use the same path syntax (Describing the Location of a WMI Object).
The example I was following is located on Connecting to the WMI Provider:
' Method 1
set locatorObj = CreateObject("WbemScripting.SWbemLocator")
set providerObj = locatorObj.ConnectServer("MyMachine", "root/MicrosoftIISv2")
set nodeObj = providerObj.Get("IIsWebVirtualDir='W3SVC/1/Root'")
' Method 2
set providerObj = GetObject("winmgmts://MyMachine/root/MicrosoftIISv2")
set nodeObj = providerObj.get("IIsWebVirtualDir='W3SVC/1/ROOT'")
' Method 3
set nodeObj = GetObject("winmgmts://MyMachine/root/MicrosoftIISv2:IIsWebVirtualDir='W3SVC/1/ROOT'")