__ACE

ACE

Represents an access control entry (ACE).

On this page

Main example

List instances

# All instances of __ACE, with the main properties
Get-CimInstance -ClassName __ACE -Namespace 'root' |
    Select-Object -Property AccessMask, AceFlags, AceType, GuidInheritedObjectType

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  = '__ACE'
        Namespace  = 'root'
    }
    Get-CimInstance @cimParameters |
        Select-Object -Property AccessMask, AceFlags, AceType, GuidInheritedObjectType
} 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 __ACE -Namespace 'root'
$cimClass.CimClassProperties |
    Select-Object -Property Name, CimType, Flags

Properties

7 of 7 properties
NameTypeAccessDescription
AccessMaskstringread/write

Bit flags representing rights that are granted or denied to the trustee. For more information and a description of the flags, see AccessMask property in the Win32_ACE class.

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

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

# Warning: changes AccessMask on the instance. -WhatIf shows the operation without running it.
# Target instance
$instance = Get-CimInstance -ClassName __ACE -Namespace 'root' |
    Select-Object -First 1
$setParameters = @{
    InputObject = $instance
    Property    = @{ AccessMask = 'Example' }
    WhatIf      = $true  # Remove this line to actually apply the change
}
Set-CimInstance @setParameters
AceFlagsstringread/write

Bit flags specifying the inheritance of the ACE. For more information and a description of the flags, see AceFlags property in the Win32_ACE class.

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

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

# Warning: changes AceFlags on the instance. -WhatIf shows the operation without running it.
# Target instance
$instance = Get-CimInstance -ClassName __ACE -Namespace 'root' |
    Select-Object -First 1
$setParameters = @{
    InputObject = $instance
    Property    = @{ AceFlags = 'Example' }
    WhatIf      = $true  # Remove this line to actually apply the change
}
Set-CimInstance @setParameters
AceTypestringread/write

The type of ACE entry that this instance represents.

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

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

# Warning: changes AceType on the instance. -WhatIf shows the operation without running it.
# Target instance
$instance = Get-CimInstance -ClassName __ACE -Namespace 'root' |
    Select-Object -First 1
$setParameters = @{
    InputObject = $instance
    Property    = @{ AceType = 'Example' }
    WhatIf      = $true  # Remove this line to actually apply the change
}
Set-CimInstance @setParameters
GuidInheritedObjectTypestringread/write

The GUID of the parent of the object to which the access rights in the AccessMask property apply.

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

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

# Warning: changes GuidInheritedObjectType on the instance. -WhatIf shows the operation without running it.
# Target instance
$instance = Get-CimInstance -ClassName __ACE -Namespace 'root' |
    Select-Object -First 1
$setParameters = @{
    InputObject = $instance
    Property    = @{ GuidInheritedObjectType = 'Example' }
    WhatIf      = $true  # Remove this line to actually apply the change
}
Set-CimInstance @setParameters
GuidObjectTypestringread/write

The GUID that indicates the type of object to which the rights in the AccessMask property apply.

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

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

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

The time, in the CIM_DATETIME format, when the security descriptor was created.

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

The trustee of the ACE entry represented by this instance of the __ACE class.

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

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

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

Remarks

This class provides the properties that are inherited by the Win32_ACE class, which is a member of the Win32_SecurityDescriptor class. 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

  1. __SecurityRelatedClass
  2. __ACE

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.