Main example
List instances
# All instances of __SystemSecurity
Get-CimInstance -ClassName __SystemSecurity -Namespace 'root'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 = '__SystemSecurity'
Namespace = 'root'
}
Get-CimInstance @cimParameters
} 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 __SystemSecurity -Namespace 'root'
$cimClass.CimClassProperties |
Select-Object -Property Name, CimType, Flags
# Methods of the class
$cimClass.CimClassMethods |
Select-Object -Property Name, ReturnTypeProperties
No documented property.
Methods
Get9XUserList #
Gets a list of users who are allowed remote access. Note: This method does not work on supported versions of Windows. Use GetSD instead.
string Get9XUserList();Return values
| Value | Label | Description |
|---|---|---|
| WBEM_E_METHOD_DISABLED | This method is not supported on supported versions of Windows. |
Call the Get9XUserList method
review before running# Warning: this method can change the system. -WhatIf shows the operation without running it.
# Target instance
$instance = Get-CimInstance -ClassName __SystemSecurity -Namespace 'root'
$methodParameters = @{
InputObject = $instance
MethodName = 'Get9XUserList'
WhatIf = $true # Remove this line to actually run the method
}
$result = Invoke-CimMethod @methodParameters
# With -WhatIf nothing runs and no result is returned
if ($result) {
$result.ReturnValue
}This method can change the system. The -WhatIf parameter shows the operation without running it: remove it only after checking.
Set9XUserList #
Sets a list of users who are allowed remote access. Note: This method does not work on supported versions of Windows. Use SetSD instead.
string Set9XUserList();Return values
| Value | Label | Description |
|---|---|---|
| WBEM_E_METHOD_DISABLED | This method is not supported. |
Call the Set9XUserList method
review before running# Warning: this method can change the system. -WhatIf shows the operation without running it.
# Target instance
$instance = Get-CimInstance -ClassName __SystemSecurity -Namespace 'root'
$methodParameters = @{
InputObject = $instance
MethodName = 'Set9XUserList'
WhatIf = $true # Remove this line to actually run the method
}
$result = Invoke-CimMethod @methodParameters
# With -WhatIf nothing runs and no result is returned
if ($result) {
$result.ReturnValue
}This method can change the system. The -WhatIf parameter shows the operation without running it: remove it only after checking.
Remarks
You can require that client scripts and applications use an encrypted connection for authentication by adding the RequiresEncryption qualifier to the .mof file that creates the namespace. You can also modify an existing namespace by adding this attribute and compile the .mof file again. For more information about how to use RequiresEncryption, see Requiring an Encrypted Connection to a Namespace.
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.