Export (0) Print
Expand All
This topic has not yet been rated - Rate this topic

WmiConfigurationAttribute Class

The WmiConfiguration attribute indicates that an assembly contains code that implements a WMI provider by using the WMI.NET Provider Extensions model. The attribute accepts parameters that establish the high-level configuration of the implemented WMI provider.

Namespace:  System.Management.Instrumentation
Assembly:  System.Core (in System.Core.dll)
[AttributeUsageAttribute(AttributeTargets.Assembly)]
[HostProtectionAttribute(SecurityAction.LinkDemand, MayLeakOnAbort = true)]
public sealed class WmiConfigurationAttribute : Attribute
NoteNote:

The HostProtectionAttribute attribute applied to this type or member has the following Resources property value: MayLeakOnAbort. The HostProtectionAttribute does not affect desktop applications (which are typically started by double-clicking an icon, typing a command, or entering a URL in a browser). For more information, see the HostProtectionAttribute class or SQL Server Programming and Host Protection Attributes.

The following table lists the parameters accepted by this attribute along with what aspect of the provider configuration it enables you to control.

Parameter

Configures

[Scope]

The namespace in which your provider exposes classes.

[NamespaceSecurity]

  • The security (DACL) on the namespace used.

[HostingModel]

  • The hosting model that will be used by the provider.

[IdentifyLevel]

  • The impersonation mode of the provider.

[HostingGroup]

The hosting group that the provider belongs to. This parameter only applies to in-process providers.

[SecurityRestriction]

The security (DACL) on the WMI provider.

// Specify that this assembly contains code that implements a WMI
// Provider. Use the assembly:WmiConfiguration attribute to define
// the WMI namespace, the hosting model, and the impersonation mode
// of the WMI provider.
// The attribute below specifies that the class this provider
// exposes to WMI will be in the root/MortgageCalc namespace, will
// use the decoupled hosting model and will not allow the provider
// to impersonate its callers.

[assembly: WmiConfiguration("root/MortgageCalc",HostingModel = ManagementHostingModel.Decoupled, IdentifyLevel = false)]
System.Object
  System.Attribute
    System.Management.Instrumentation.WmiConfigurationAttribute
Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Windows 7, Windows Vista, Windows XP SP2, Windows Server 2008 R2, Windows Server 2008, Windows Server 2003

The .NET Framework and .NET Compact Framework do not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

.NET Framework

Supported in: 3.5
Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

ADD
Show:
© 2014 Microsoft. All rights reserved.