WMI namespace root \ cimv2 not available in Win2k?

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.

0
source share
3 answers

Finally, what worked for me is restoring the WMI repository. This is what I did:

  • Stop WMI service (net stop winmgmt)
  • Go to% windows% / system32 / wbem (in my win2k, winnt, there will be windows on XP)
  • Rename or delete repository directory
  • WMI (net start winmgmt)

, ( WMI ):

winmgmt /clearadap
winmgmt /kill
winmgmt /unregserver
winmgmt /regserver
winmgmt /resyncperf

Uros , -, .

+1

, . wmidiag.vbs, WMI, "", ( )

+1

Windows Server 2003, Service Pack 2, yorch . , Server 2003:

http://www.djordjepejic.com/kb68/index.php/article/winmgmt-could-not-initialize-the-core-parts-solved-even/

For Windows Server 2003 Use the following command to detect and repair a damaged WMI repository:

rundll32 wbemupgd, RepairWMISetup

+1
source

Source: https://habr.com/ru/post/1794133/


All Articles