TestimoX

API Reference

Class

WmiNamespacePermissions

Namespace ComputerX.Wmi
Assembly ComputerX
Modifiers static
Attributes
SupportedOSPlatform("windows")

Helpers to read and modify WMI namespace DACL using __SystemSecurity Get/SetSecurityDescriptor. Rights are expressed via WmiNamespaceRights.

Inheritance

  • Object
  • WmiNamespacePermissions

Methods

public static IEnumerable<Entry> Get(String namespace, String computerName = null) #
Returns: IEnumerable<Entry>

Reads the current namespace DACL entries.

Parameters

namespace System.String requiredposition: 0
computerName System.String = null optionalposition: 1

Examples


var items = WmiNamespacePermissions.Get("root\\cimv2");
        
public static Boolean Merge(String computerName, String namespace, IEnumerable<Entry> addEntries) #
Returns: Boolean

Adds Allow/Deny entries to the namespace (merge semantics — unions masks for same identity/type).

Parameters

computerName System.String requiredposition: 0
namespace System.String requiredposition: 1
addEntries System.Collections.Generic.IEnumerable{ComputerX.Wmi.WmiNamespacePermissions.Entry} requiredposition: 2

Examples


WmiNamespacePermissions.Merge(null, "root\\subscription", new[]{ new WmiNamespacePermissions.Entry { Identity = @"DOMAIN\\Auditors", Rights = WmiNamespaceRights.ReadSecurity } });
        
public static Boolean Set(String computerName, String namespace, IEnumerable<Entry> entries) #
Returns: Boolean

Replaces the namespace DACL with the provided entries (authoritative set).

Parameters

computerName System.String requiredposition: 0
namespace System.String requiredposition: 1
entries System.Collections.Generic.IEnumerable{ComputerX.Wmi.WmiNamespacePermissions.Entry} requiredposition: 2

Examples


WmiNamespacePermissions.Set("SRV1", "root\\cimv2", new[]{ new WmiNamespacePermissions.Entry { Identity = @"DOMAIN\\Ops", Rights = WmiNamespaceRights.RemoteEnable|WmiNamespaceRights.ExecuteMethods } });