API Reference
Class
WmiNamespacePermissions
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
- computerName System.String = null
Examples
var items = WmiNamespacePermissions.Get("root\\cimv2");
public static Boolean Merge(String computerName, String namespace, IEnumerable<Entry> addEntries) #Returns:
BooleanAdds Allow/Deny entries to the namespace (merge semantics — unions masks for same identity/type).
Parameters
- computerName System.String
- namespace System.String
- addEntries System.Collections.Generic.IEnumerable{ComputerX.Wmi.WmiNamespacePermissions.Entry}
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:
BooleanReplaces the namespace DACL with the provided entries (authoritative set).
Parameters
- computerName System.String
- namespace System.String
- entries System.Collections.Generic.IEnumerable{ComputerX.Wmi.WmiNamespacePermissions.Entry}
Examples
WmiNamespacePermissions.Set("SRV1", "root\\cimv2", new[]{ new WmiNamespacePermissions.Entry { Identity = @"DOMAIN\\Ops", Rights = WmiNamespaceRights.RemoteEnable|WmiNamespaceRights.ExecuteMethods } });
Inherited Methods
public override Boolean Equals(Object obj) #Returns:
BooleanInherited from Object
Parameters
- obj Object