__SecurityDescriptor

Security Descriptor

Represents a security descriptor.

On this page

Main example

List instances

# All instances of __SecurityDescriptor, with the main properties
Get-CimInstance -ClassName __SecurityDescriptor -Namespace 'root' |
    Select-Object -Property ControlFlags, DACL, Group, Owner

Examples

Query a remote computer (CIM session)

review before running
# Name of the remote computer
$computerName = 'SERVER01'
# The CIM session (WSMan by default) can be reused for several queries
$cimSession = New-CimSession -ComputerName $computerName
try {
    $cimParameters = @{
        CimSession = $cimSession
        ClassName  = '__SecurityDescriptor'
        Namespace  = 'root'
    }
    Get-CimInstance @cimParameters |
        Select-Object -Property ControlFlags, DACL, Group, Owner
} finally {
    Remove-CimSession -CimSession $cimSession
}

WSMan (WinRM) is used by default. For a host without WinRM, create the session with -SessionOption (New-CimSessionOption -Protocol Dcom). Add -Credential to use another account.

Show the class structure

# Class structure: properties, types and flags (Key, ReadOnly…)
$cimClass = Get-CimClass -ClassName __SecurityDescriptor -Namespace 'root'
$cimClass.CimClassProperties |
    Select-Object -Property Name, CimType, Flags

Properties

6 of 6 properties
NameTypeAccessDescription
ControlFlagsuint32read

Bit flags that provide information about the descriptor's contents and format. See the ControlFlags property in the Win32_SecurityDescriptor class for a description of the flags.

Code
# Value of ControlFlags for each instance
$cimParameters = @{
    ClassName = '__SecurityDescriptor'
    Namespace = 'root'
    Property  = 'ControlFlags'
}
Get-CimInstance @cimParameters |
    Select-Object -Property ControlFlags
DACL__ACE[]read/write

An array of __ACE entries that specify access to the object.

Code
# Value of DACL for each instance
# DACL is an array: -ExpandProperty returns its items one by one
$cimParameters = @{
    ClassName = '__SecurityDescriptor'
    Namespace = 'root'
    Property  = 'DACL'
}
Get-CimInstance @cimParameters |
    Select-Object -ExpandProperty DACL

Warning. Changes the system: check with -WhatIf first. An elevated console is often required.

# Warning: changes DACL on the instance. -WhatIf shows the operation without running it.
# Target instance
$instance = Get-CimInstance -ClassName __SecurityDescriptor -Namespace 'root' |
    Select-Object -First 1
$setParameters = @{
    InputObject = $instance
    Property    = @{ DACL = @($null) }
    WhatIf      = $true  # Remove this line to actually apply the change
}
Set-CimInstance @setParameters
Group__ACEread

ACE that identifies the trustee representing the group of the object.

Code
# Value of Group for each instance
$cimParameters = @{
    ClassName = '__SecurityDescriptor'
    Namespace = 'root'
    Property  = 'Group'
}
Get-CimInstance @cimParameters |
    Select-Object -Property Group
Owner__ACEread

ACE that identifies the trustee representing the owner of the object.

Code
# Value of Owner for each instance
$cimParameters = @{
    ClassName = '__SecurityDescriptor'
    Namespace = 'root'
    Property  = 'Owner'
}
Get-CimInstance @cimParameters |
    Select-Object -Property Owner
SACL__ACEread

An array of __ACE entries that identifies users and groups for which auditing information is gathered.

Code
# Value of SACL for each instance
$cimParameters = @{
    ClassName = '__SecurityDescriptor'
    Namespace = 'root'
    Property  = 'SACL'
}
Get-CimInstance @cimParameters |
    Select-Object -Property SACL
TIME_CREATEDuint64read

Time in the CIM_DATETIME format when the security descriptor was created.

Code
# Value of TIME_CREATED for each instance
$cimParameters = @{
    ClassName = '__SecurityDescriptor'
    Namespace = 'root'
    Property  = 'TIME_CREATED'
}
Get-CimInstance @cimParameters |
    Select-Object -Property TIME_CREATED

Remarks

This class provides properties inherited by Win32_SecurityDescriptor. For more information, see WMI Security Descriptor Objects and Changing Access Security on Securable Objects. For more information about ACEs, see Access Control Components.

Inheritance

Superclass chain

This class has no superclass.

Known subclasses

No known subclass.

Requirements

Namespace
root
Minimum client
Windows Vista
Minimum server
Windows Server 2008
DLL
All

Microsoft source

Source: Microsoft Learn

Descriptions, properties and methods come from the Microsoft documentation (MicrosoftDocs/win32 repository), published under the CC BY 4.0 licence. Formatting and translations are specific to this site; the PowerShell examples are written for it.