Main example
List instances
# All instances of __Trustee, with the main properties
Get-CimInstance -ClassName __Trustee -Namespace 'root' |
Select-Object -Property Name, Domain, SidLength, SidStringExamples
Filter with WQL
# WQL filter evaluated by the provider: names starting with "a" (the WQL wildcard is %)
$cimParameters = @{
ClassName = '__Trustee'
Namespace = 'root'
Filter = "Name LIKE 'a%'"
}
Get-CimInstance @cimParameters |
Select-Object -Property Name, Domain, SidLength, SidStringThe filter is evaluated by the WMI provider: less data is transferred than with Where-Object.
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 = '__Trustee'
Namespace = 'root'
}
Get-CimInstance @cimParameters |
Select-Object -Property Name, Domain, SidLength, SidString
} 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 __Trustee -Namespace 'root'
$cimClass.CimClassProperties |
Select-Object -Property Name, CimType, FlagsProperties
| Name | Type | Access | Description |
|---|---|---|---|
| Domain# | string | read/write | Domain portion of the account. CodeWarning. Changes the system: check with -WhatIf first. An elevated console is often required. |
| Name# | string | read/write | Name portion of the account. CodeWarning. Changes the system: check with -WhatIf first. An elevated console is often required. |
| SID# | uint8[] | read/write | The SID of the trustee in the binary byte array form. CodeWarning. Changes the system: check with -WhatIf first. An elevated console is often required. |
| SidLength# | uint32 | read/write | The length of the SID in bytes. CodeWarning. Changes the system: check with -WhatIf first. An elevated console is often required. |
| SidString# | string | read/write | The SID of the trustee in the string format, for example, "S-1-1-0". CodeWarning. Changes the system: check with -WhatIf first. An elevated console is often required. |
| TIME_CREATED# | uint64 | read | Time in the CIM_DATETIME format when the security descriptor was created. Code |
Remarks
This class provides properties that are inherited by the Win32_Trustee 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
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
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.