Wmic ошибка недопустимый класс

Try

This is not a full list (wmic). This is only products installed with Windows Installer. There is no feature for everything.

However as I said in my previous post nearly everything is listed in the registry.

So to see it in a command prompt

reg query HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall /s

Also your error code seems invalid. There is no 27a windows error or 0xc000027a NT Status code. It seems wrong for a COM containing NTSTatus 0xd000027a or COM with Windows error 0x8007027a.

Clean Booting

Each of the three steps turns of programs, services, and drivers in increasing amounts. Thus narrowing down the possible culprits.

Clean Boot

Click Start — All Programs — Accessories — Run and type

msconfig

Then go to the Startup tab. Untick everything. Then go to the Services tab. Tick Hide All Microsoft Services and untick everything that’s left.

Reboot. If this solves your problem reenable ½ of the services/startup items until you find which one.

Advanced Clean Boot

If the above doesn’t help.

Download Autoruns from http://technet.microsoft.com/en-us/sysinternals/bb963902.aspx

Start the program by right clicking and choosing Run As Administrator and click Options menu — Filter Options and tick Hide Microsoft entries and clear Include Empty Locations. Untick everything left.

Reboot. If this solves your problem reenable ½ of the items until you find which one.

Safe Mode

If the above doesn’t help.

Use Safe Mode with Networking if you need internet access.

Click Start — All Programs — Accessories — Run and type

msconfig

Then go to the Boot tab and click Safe Boot (also tick Network if needed). Reboot. Come back here and untick Safe Boot to return to normal mode.

or

If your computer has a single operating system installed, repeatedly press the F8 key as your computer restarts. You need to press F8 before the Windows logo appears. If the Windows logo appears, you will need to try again. [From Start — Help and Support]

Startup Repair

If your computer has a single operating system installed, repeatedly press the F8 key as your computer restarts. You need to press F8 before the Windows logo appears. If the Windows logo appears, you will need to try again. [From Start — Help and Support].

On the Advanced Boot Options screen, use the arrow keys to highlight Repair your computer, and then press ENTER.

Select Startup Repair.

Startup repair makes a log file. See C:\Windows\System32\LogFiles\Srt\SrtTrail.txt.

To access if Windows won’t start, on the Advanced Boot Options screen, use the arrow keys to highlight Repair your computer, and then press ENTER.

Select Command Prompt.

Type

type C:\Windows\System32\LogFiles\Srt\SrtTrail.txt |more

Also type explorer in your command prompt and see what happens.

My Explorer fixes listsways of using windows without the graphical shell.

To See if a Fix is Available

In Control Panel (and select Classic view in the left hand pane) choose Problem Reports and Solutions (type problem in Start’s search box), go to Problem History, right click your error and choose Check For Solution.

You may also right click and choose Details for more info. Post those details here. The Fault Module Name is the important information.

If the problem affects Control Panel press Winkey + R and type wercon (or type it in a command prompt).


Close Explorer and Start a Command Prompt

Close any Explorer windows

Start — All Programs — Accessories — Right click Command Prompt and choose Run As Administrator.

Click Start. Ctrl + Shift + Right click a blank spot (just above the power buttons is one place) then Exit Explorer.

Press Ctrl + Alt + Delete then Task Manager.

Check all explorer processes are closed. On the Process tab select explorer and right click and choose End Process, repeat if more than one explorer in the list.

Then to restart explorer after trying each of the following

Press Ctrl + Alt + Delete and choose Task Manager

In Task Manager click the File menu then New Task (Run) and type explorer


If You Can’t Start Explorer at All

Press Ctrl + Alt + Delete and choose Task Manager

On the Process tab click Show Processes From All Users to elevate to Administrator
In Task Manager click the File menu then New Task (Run) and type cmd
Other things you can try typing

Explorer
Explorer c:\
Explorer /e,c:\
wercon
control
iexplore
rstrui

If you can’t start a folder window use the Browse button in the New Task dialog. Remember you need to right click and choose Open rather than double clicking.


I am trying to get PCoIP Statistics which are available through WMI, I use following command for WMIC

 wmic path Win32_PerfRawData_TeradiciPerf_PCoIPSessionNetworkStatistics

or with powershell

powershell Get-WmiObject -namespace "root\cimv2" -computername computer01 -class Win32_PerfRawData_TeradiciPerf_PCoIPSessionNetworkStatistics

However when I tried to run either command forked through another process, in this case it was python, and piping the stdout, I am getting Invalid class error like below.

 Get-WmiObject : Invalid class
At line:1 char:14
+ Get-WmiObject <<<  -namespace root\cimv2 -computername computer01 -class
 Win32_PerfRawData_TeradiciPerf_PCoIPSessionNetworkStatistics
    + CategoryInfo          : InvalidOperation: (:) [Get-WmiObject], ManagementException
    + FullyQualifiedErrorId : GetWMIManagementException,Microsoft.PowerShell.Commands.GetWmiObjectCommand

if it helps, the output of powershell command through command prompt is

__GENUS                   : 2
__CLASS                   : Win32_PerfRawData_TeradiciPerf_PCoIPSessionNetworkS
                            tatistics
__SUPERCLASS              : Win32_PerfRawData
__DYNASTY                 : CIM_StatisticalInformation
__RELPATH                 : Win32_PerfRawData_TeradiciPerf_PCoIPSessionNetworkS
                            tatistics.Name="PCoIP Session"
__PROPERTY_COUNT          : 19
__DERIVATION              : {Win32_PerfRawData, Win32_Perf, CIM_StatisticalInfo
                            rmation}
__SERVER                  : DEMO-VSGA-WS01
__NAMESPACE               : rootcimv2
__PATH                    : \DEMO-VSGA-WS01rootcimv2:Win32_PerfRawData_Terad
                            iciPerf_PCoIPSessionNetworkStatistics.Name="PCoIP S
                            ession"
Caption                   :
Description               :
Frequency_Object          : 0
Frequency_PerfTime        : 10000000
Frequency_Sys100NS        : 10000000
Name                      : PCoIP Session
RoundTripLatencyms        : 284
RXBWkbitPersec            : 22034
RXBWPeakkbitPersec        : 4
RXPacketLossPercent       : 112
RXPacketLossPercent_Base  : 28805
Timestamp_Object          : 0
Timestamp_PerfTime        : 299873128867
Timestamp_Sys100NS        : 130641888164850000
TXBWActiveLimitkbitPersec : 1832
TXBWkbitPersec            : 75615
TXBWLimitkbitPersec       : 90000
TXPacketLossPercent       : 7
TXPacketLossPercent_Base  : 30942

I also tried using python module WMI

hostname = os.getenv('COMPUTERNAME', '')
c = wmi.WMI (hostname, namespace="root\\cimv2")
print c.Win32_PerfRawData_TeradiciPerf_PCoIPSessionNetworkStatistics

I am getting following error

print c.Win32_PerfRawData_TeradiciPerf_PCoIPSessionNetworkStatistics
  File "c:\users\ramesh~1\appdata\local\temp\easy_install-tlfipc\WMI-1.4.9-py2.7
-win32.egg.tmp\wmi.py", line 1147, in __getattr__
  File "C:\Python27\lib\site-packages\win32com\client\dynamic.py", line 522, in
__getattr__
    raise AttributeError("%s.%s" % (self._username_, attr))
AttributeError: winmgmts://computer01/root/cimv2.Win32_PerfRawData_TeradiciP
erf_PCoIPSessionNetworkStatistics

Can this be related to impersonation and authentication level of caller?

UPDATE

I moved the powershell command to a bat file, when I run the bat file through CMD, it’s again working fine.

When Popen through python, it showing same error. If it helps I am using python code.

p = subprocess.Popen ('bat.bat',stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
print p.stdout.read()

I tried listing the classes under the namespace, the class was listed when the bat file was called through CMD, when Popen, none of Teradici’s classes were available. The command line in bat.bat is

powershell Get-WmiObject -namespace "root\cimv2" -computername computer01 -list

All this is being run on VMWare VDI (Virtual Desktop Infrastructure), can there be any policy restrictions?

  • Remove From My Forums
  • Вопрос

  • Windows 2003 Server Standard Edition SP2. Только что переустановил, никакого другого софта еще не установлено. При запуске из консоли wmic product get name выдается ошибка:

    Узел — имя_компьютера

    ОШИБКА:

    Код = 0x80041010

    Описание = Недопустимый класс

    Услуга WMI

    Службы WMI запущены и функционируют нормально. На другие параметры wmic откликается а вот на wmic product не хочет. Может кто нибудь знает как это лечится? при поиске данной ошибки заметил, что у многих не работает в указанной ОС.

Ответы

  • а погуглить не судьба?

    доустановите компоненту WMI Windows Installer Provider (Add\Remove Programs -> Add\Remove Windows components -> Management and Monitoring tools)

    ——————————

    проверил — работает

    C:\Documents and Settings\Administrator>wmic product
    Node — DHCPSRV
    ERROR:
    Code = 0x80041010
    Description = Invalid class
    Facility = WMI

    C:\Documents and Settings\Administrator>wmic product
    Caption                                      Description
    VMware Tools                                 VMware Tools
    Microsoft .NET Framework 2.0 Service Pack 1  Microsoft .NET Fram
    Microsoft File Server Migration Toolkit      Microsoft File Serv
    Windows Support Tools                        Windows Support Too

    • Помечено в качестве ответа

      15 сентября 2010 г. 9:14

WMIC PRODUCT Returns Invalid Class Error 0x80041010

To say that I use WMI (and WMIC) on a daily basis is an understatement. It saves me so much time, but I did run into this bug which I wasted a little time on.

I remembered that there was a WMIC alias called PRODUCT which returned a lot of useful data about what software was installed on the Windows Server 2003 instance. However when I changed jobs from one organisation to another, this function no longer worked for me. I would get an error just like this one:

C:\WINDOWS\system32>wmic product
Node — Server1
ERROR:
Code = 0x80041010
Description = Invalid class
Facility = WMI

The solution was very simple. It turns out that the Windows Installer information is not available in WMI until you install an optional Windows component called «WMI Windows Installer Provider». This component can be installed through «Add/Remove Windows Components»… look for the «Management and Monitoring Tools» group.

If you plan on deploying this to a large fleet of servers, I would recommend you learn about a tool for enabling Windows components in an automated way. The Microsoft tool to do that is called SysOCMgr.exe and is described here. I might right some detailed stuff about SysOCMgr.exe later, so watch this space.

I went and wrote a powershell script that performs a software audit of a Microsoft network. However half the machines on the network returned an error saying Invalid Class 0x80041010. When I ran a wmi query against a failed computer manually, sure thing it failed again!

wmic /Failfast:on /node:»ausdc01″ product GET /all

Node — AUSDC01
ERROR:
Code = 0x80041010
Description = Invalid class
Facility = WMI

When powershell queried it I also got an error:

Get-WmiObject : Invalid Class

When performing these queries against the server the following event logs were generated under the Application logs:

Event Type: Error
Event Source: WinMgmt
Event Category: None
Event ID: 10
Date: 1/12/2009
Time: 9:57:43 AM
User: N/A
Computer: AUSDC01
Description:
Event filter with query «select * from MSMCAEvent_MemoryError where (type = 3221553223) and (LogToEventlog <> 0)» could not be (re)activated in namespace «//./root/WMI» because of error 0x80041010. Events may not be delivered through this filter until the problem is corrected.

Event Type: Error
Event Source: WinMgmt
Event Category: None
Event ID: 10
Date: 1/12/2009
Time: 9:57:43 AM
User: N/A
Computer: AUSDC01
Description:
Event filter with query «select * from MSMCAEvent_PCIBusError where (type = 2147811416) and (LogToEventlog <> 0)» could not be (re)activated in namespace «//./root/WMI» because of error 0x80041010. Events may not be delivered through this filter until the problem is corrected.

Event Type: Error
Event Source: WinMgmt
Event Category: None
Event ID: 10
Date: 1/12/2009
Time: 9:57:43 AM
User: N/A
Computer: AUSDC01
Description:
Event filter with query «select * from MSMCAEvent_SMBIOSError where (type = 3221553253) and (LogToEventlog <> 0)» could not be (re)activated in namespace «//./root/WMI» because of error 0x80041010. Events may not be delivered through this filter until the problem is corrected.

Event Type: Error
Event Source: WinMgmt
Event Category: None
Event ID: 10
Date: 1/12/2009
Time: 9:57:43 AM
User: N/A
Computer: AUSDC01
Description:
Event filter with query «select * from MSMCAEvent_CPUError where (type = 2147811392) and (LogToEventlog <> 0)» could not be (re)activated in namespace «//./root/WMI» because of error 0x80041010. Events may not be delivered through this filter until the problem is corrected.

Event Type: Error
Event Source: WinMgmt
Event Category: None
Event ID: 10
Date: 1/12/2009
Time: 9:57:43 AM
User: N/A
Computer: AUSDC01
Description:
Event filter with query «select * from MSMCAEvent_PlatformSpecificError where (type = 3221553255) and (LogToEventlog <> 0)» could not be (re)activated in namespace «//./root/WMI» because of error 0x80041010. Events may not be delivered through this filter until the problem is corrected.

I installed WMITools on both a server that was working correctly and a server that was not working. Download WMITools from here:

http://www.microsoft.com/downloads/details.aspx?familyid=6430F853-1120-48DB-8CC5-F2ABDC3ED314&displaylang=en

In the WMI CIM Studio I saw that on one server the CIM_Products\Win32_Product WMI class existed on one server, but not on the other.

Server that fails with the WMI error 0x80041010:

Server that worked:

After some more research I found out that this Win32_Product class object gets added in when the Management and Monitoring Tools —> WMI Windows Installer Provider is installed.

Add this component and it will resolve the problem:

Remotely Pushout WMI Windows Installer Provider

In my case I want to to use the WMI Windows Installer Provider to perform a software inventory of my network. I cannot do this if this component isn’t installed on every computer through out my domain. It is installed by default on vista, 2008 and windows 7 by default but not windows XP or 2003.

To do this first we must place the i386 folder from a Windows 2003 CD on a network share as WMI Windows Installer Provider requires a few files from it.

Next we are going to have to create a custom .reg file to change the place where our computers look for i386 directory for windows component files. This data is located under:

HKLM\Software\Microsoft\Windows\CurrentVersion\Setup

The two main values we need to change is CDInstall to be 0, as we are not installing from a CD and SourcePath. Whatever you put as SourcePath the add and remove windows components utility will add \i386 to the end of it. I shared my i386 directory out as «i386» so to navigate to it I need to type \\ausdc01\i386. This means for my SoucePath I enter it as \\ausdc01.

The default value for SourcePath is D:

Next we need to export the changes to a .reg file. Right click on Setup and click Export. Make sure the export range is set to Selected branch and not all.

Once exported open up the .reg file in notepad. There are many registry directory keys under the Setup folder that would have been exported along with our data. These are not required and need to be removed. Please click the below image to enlarge. Everything south of the red square should be removed. Also please remove BootDir encase we actually do have a server that doesn’t have C:\ as its boot partition!

Copy the registry file you have crated to a network share. In my environment I just used the netlogon directory in which I created a folder wmichange \\domain\netlogon\wmichange.

You could use pstools or a startup script to make this change on servers now by simply scripting:

regedit /s \\domain\netlogon\wmichange\installsource.reg

However we are going to encompase this as part of our same script.

Next we need to make an unattended setup file, much like we do when we are doing desktop or server deployment on large scales. Create the file under the same directory as above. I called mine answer.txt

\\domain\netlogon\wmichange\answer.txt

In the answer file enter:

[Components]
WbemMSI = On

This is what is required to install the Management and Monitoring Tools —> WMI Windows Installer Provider component.

You can specify any components in add and remove windows components in an answer file. Here are some good links for future reference:

http://itk.samfundet.no/dok-filer/ms-xp-sp2-deployment-ref/u_components.htm
http://forums.techarena.in/server-scripting/738510.htm

The command to kick off this unattended install is:

sysocmgr.exe /i:%windir%\inf\sysoc.inf /u:\\domain\netlogon\wmichange\answer.txt

This will go through and add the WMI Windows Installer Provider component for us.

This should install the component without even prompting for any user interaction. It will pull the files of the network share as configured above.

Now finally lets create a batch script under our \\domain\netlogon\wmichange\ directory called run.bat

Put both commands in the bat file:

regedit /s \\domain\netlogon\wmichange\installsource.reg
sysocmgr.exe /i:%windir%\inf\sysoc.inf /u:\\domain\netlogon\wmichange\answer.txt

Now you got two methods to use this, you can either run it remotely using PSExec or you can use startup scripts. Below I will only show how to use PSExec.

PSexec is a program to remotely execute commands which is part of the PSTools pack… get it from:

http://technet.microsoft.com/en-us/sysinternals/bb896649.aspx

PSExec has the capability of running a command against every computer in a domain, or a list of computers from a text file. Remember only 2003 and XP dont have WMI Windows Installer Provider installed by default, so we only want to do these.

Below I will run the command against a single computer CANHQDC01 which did not have the WMI Windows Installer Provider installed.

psexec \\CANHQDC01 «\\domain\netlogon\wmichange\run.bat»

Below shows you the output of the command and how it carried out all the tasks:

Error code 0 is good, it means there were no errors. Now I can perform software audits on CANHQDC01 using WMI where before I couldn’t!

Понравилась статья? Поделить с друзьями:
  • Wolfenstein ошибка could not write crash dump
  • Wolfenstein youngblood ошибка при запуске синий экран
  • Wmic exe ошибка при запуске приложения 0xc0000142
  • Wolf ошибка 052
  • Wmi приложение ошибка