PowerShell for Windows Admins

May 23 2012   12:46PM GMT

WMI providers

Richard Siddaway Richard Siddaway Profile: Richard Siddaway

I found a class new to me – Msft_Providers and this got me interested in WMI providers.

PS> Get-CimInstance -Class Msft_Providers | select -ExpandProperty provider
Msft_ProviderSubSystem
SCM Event Provider
WmiPerfClass

 

That seems a bit low. Digging a bit more I got back to the old favourite __provider.

Get-CimInstance -Class __provider | Measure-Object

produces an answer of 43 – not quite the answer to life, the universe and everything but close.

Is there any overlap between the two groups of providers?

 

$providers = Get-CimInstance -Class Msft_Providers | select -ExpandProperty provider           
Get-CimInstance -Class __provider | where Name -in $providers | select Name

 

provides the answer

Msft_ProviderSubSystem  

SCM Event Provider

 

In case you were wondering – “Starting with Windows Vista, the WMIPerfClass Provider and the WMIPerfInst Provider dynamically provide performance counter data for the WMI Performance Counter Classes.”

see http://msdn.microsoft.com/en-us/library/windows/desktop/aa392740(v=vs.85).aspx

 

One interesting property is the Hosting Model

Get-CimInstance -Class __provider | select HostingModel -Unique

Decoupled:NonCOM
NetworkServiceHost
WmiCore
LocalSystemHost
LocalServiceHost

NetworkServiceHost:[ReliabilityMetricsProvider]

 

But what do these mean

Full explanations for these and the other hosting models can be found at

http://msdn.microsoft.com/en-us/library/aa392509(VS.85).aspx

WmiCore – Activate provider in host to the WMI service. This hosting model is only supported for operating system components.

WmiCoreOrSelfHost – Activate provider in host to the WMI service or as local server. This hosting model is only supported for operating system components.

SelfHost – Activate provider as a local server implementation.

Decoupled:Com – Activate provider as a decoupled COM provider. See http://msdn.microsoft.com/en-us/library/aa390882(v=vs.85).aspx
 
Decoupled:NonCom – Activate provider as a non-COM event provider.
 
LocalSystemHost – Activate provider in the provider host process that is running under the LocalSystem account.

LocalSystemHostOrSelfHost – The provider is self-hosted or loaded into the Wmiprvse.exe process running under the LocalSystem account.

NetworkServiceHost – Activate provider in the provider host process that is running under the NetworkService account.

LocalServiceHost – Activate provider in the provider host process that is running under the LocalService account.

NetworkServiceHostOrSelfHost – The provider is self-hosted or loaded into the WmiPrvse.exe process running under the NetworkService account. NetworkServiceHostOrSelfHost is the default configuration when the HostingModel property in __Win32Provider is NULL. Because NetworkServiceHostOrSelfHost is the default, providers from earlier operating systems can continue to work in Windows Vista, Windows Server 2008, and later operating systems.

Get-CIMInstance is a new cmdlet in PowerShell v3. It is part of the new API for working with WMI. I will be blogging about these in greater detail over the next weeks and months as Powershell v3 is released.

More information on providers and the CIM cmdlets can be found in PowerShell and WMIwww.manning.com/powershellandwmi

 Comment on this Post

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when other members comment.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to: