Get-WmiObject : Invalid class error

This topic contains 7 replies, has 5 voices, and was last updated by Profile photo of Veeram Varapraveen Reddy Veeram Varapraveen Reddy 1 year ago.

  • Author
    Posts
  • #29181
    Profile photo of Busch Brett
    Busch Brett
    Participant

    I'm trying to repair the SBSMonitoring database on a WIndows 2011 SBS box per this article here (http://blogs.technet.com/b/sbs/archive/2011/08/22/how-to-recreate-the-sbsmonitoring-database.aspx), but I keep getting this error (see below). Does anyone know how to resolve?

    Get-WmiObject : Invalid class
    At C:\WINDOWS\TEMP\Create-SBSMonitoringDb.ps1:33 char:10
    + if ((gwmi <<<< win32_operatingsystem).version -like "6.0*") { + CategoryInfo : InvalidOperation: (:) [Get-WmiObject], Managemen tException + FullyQualifiedErrorId : GetWMIManagementException,Microsoft.PowerShell.C ommands.GetWmiObjectCommand

  • #29182
    Profile photo of Don Jones
    Don Jones
    Keymaster

    Can you just run this on the computer?

    get-wmiobject -class win32_operatingsystem

    By itself, in a powershell console window?

  • #29184
    Profile photo of Busch Brett
    Busch Brett
    Participant

    Nope, sure can't.

    PS C:\Users\bbusch> get-wmiobject -class win32_operatingsystem
    Get-WmiObject : Invalid class
    At line:1 char:14
    + get-wmiobject <<<< -class win32_operatingsystem + CategoryInfo : InvalidOperation: (:) [Get-WmiObject], ManagementException + FullyQualifiedErrorId : GetWMIManagementException,Microsoft.PowerShell.Commands.GetWmiObjectCommand

  • #29185
    Profile photo of Curtis Smith
    Curtis Smith
    Participant

    Busch looks like you have a system issue with your WMI Class. Here is a good article on technet about troubleshooting WMI Providers and Classes that should help you out.

    http://blogs.technet.com/b/askperf/archive/2014/08/11/wmi-missing-or-failing-wmi-providers-or-invalid-wmi-class.aspx

  • #31122
    Profile photo of Busch Brett
    Busch Brett
    Participant

    WMI is verified as consistent; any other suggestions?

    PS C:\windows\temp> winmgmt /verifyrepository
    WMI repository is consistent
    PS C:\windows\temp>

  • #31123
    Profile photo of Don Jones
    Don Jones
    Keymaster

    If you've verified that you ran the command as a local Administrator, and it isn't retrieving Win32_OperatingSystem when you're in a local console window (which says "Administrator" in the title bar), then I'm gonna go with "borked system." I'm a little hesitant to recommend a fix because I'm not at all familiar with SBS or any weirdness it may have.

  • #31295
    Profile photo of Mike Eyler
    Mike Eyler
    Participant

    does this work?
    Get-WmiObject -Class "win32_operatingsystem" -Namespace "root/cimv2"

  • #39029

    Can we handle this exception !!

You must be logged in to reply to this topic.