Get-WmiObject : Invalid class error

This topic contains 7 replies, has 5 voices, and was last updated by  Veeram Varapraveen Reddy 2 years, 1 month ago.

  • Author
  • #29181

    Busch Brett

    I'm trying to repair the SBSMonitoring database on a WIndows 2011 SBS box per this article here (, 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

    Don Jones

    Can you just run this on the computer?

    get-wmiobject -class win32_operatingsystem

    By itself, in a powershell console window?

  • #29184

    Busch Brett

    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

    Curtis Smith

    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.

  • #31122

    Busch Brett

    WMI is verified as consistent; any other suggestions?

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

  • #31123

    Don Jones

    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

    Mike Eyler

    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.