I am trying to run the following VBScript code on Win2k SP4:
strComputer = "."
Set oWMIService = GetObject("winmgmts:" & "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
It works on XP and Win7 without problems, but the following error appears in this 2k box:
C:\test_wmi.vbs(3, 1) (null): 0x8004100E
Error description: Unknown namespace could not be found.
When I query namespaces in the root using this code:
strComputer = "."
Set objSWbemServices = GetObject("winmgmts:\\" & strComputer & "\root")
Set colNameSpaces = objSwbemServices.InstancesOf("__NAMESPACE")
For Each objNameSpace In colNameSpaces
Wscript.Echo objNameSpace.Name
Next
I get this:
DEFAULT
SECURITY
WMI
directory
aspnet
As far as I read, there should be a CIMV2 namespace. Any ideas ???
Thank!
yorch.
yorch source
share