Author Posts

September 1, 2015 at 8:27 am

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

September 1, 2015 at 8:33 am

Can you just run this on the computer?

get-wmiobject -class win32_operatingsystem

By itself, in a powershell console window?

September 1, 2015 at 9:00 am

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

September 1, 2015 at 9:04 am

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.

October 21, 2015 at 12:04 pm

WMI is verified as consistent; any other suggestions?

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

October 21, 2015 at 12:20 pm

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.

October 24, 2015 at 7:10 am

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

May 12, 2016 at 10:05 pm

Can we handle this exception !!