The Get-CimClass PowerShell command is a powerful tool for Windows administrators. It allows them to query the Windows Management Instrumentation (WMI) repository for information about the available classes. This command is useful for getting information about the available classes, their properties, and their methods.

The Get-CimClass command is part of the Windows PowerShell CIM (Common Information Model) cmdlets. It is used to query the WMI repository for information about the available classes. The command can be used to get information about the properties, methods, and qualifiers of a class. It can also be used to get information about the instances of a class.

Syntax of Get-CimClass

The syntax of the Get-CimClass command is as follows:

Get-CimClass [-ClassName] <string> [-Namespace <string>] [-ComputerName <string[]>] [-Credential <PSCredential>] [-Filter <string>] [-Property <string[]>] [-OperationTimeoutSec <uint32>] [-EnableAllPrivileges] [-Authentication <AuthenticationLevel>] [-Impersonation <ImpersonationLevel>] [-Locale <string>] [-ThrottleLimit <int>] [-AsJob] [-CimSession <CimSession[]>] [-ThrottleManager <ThrottleManager>] [-WhatIf] [-Confirm] [<CommonParameters>]

Parameters of Get-CimClass

The Get-CimClass command has the following parameters:

Parameter Description
-ClassName Specifies the name of the class to be retrieved.
-Namespace Specifies the namespace of the class to be retrieved.
-ComputerName Specifies the name of the computer to be queried.
-Credential Specifies the credentials to be used to connect to the computer.
-Filter Specifies a filter to be used to limit the results.
-Property Specifies the properties to be retrieved.
-OperationTimeoutSec Specifies the timeout for the operation.
-EnableAllPrivileges Specifies whether all privileges should be enabled.
-Authentication Specifies the authentication level to be used.
-Impersonation Specifies the impersonation level to be used.
-Locale Specifies the locale to be used.
-ThrottleLimit Specifies the throttle limit to be used.
-AsJob Specifies whether the command should be run as a job.
-CimSession Specifies the CIM session to be used.
-ThrottleManager Specifies the throttle manager to be used.
-WhatIf Specifies whether the command should be run in WhatIf mode.
-Confirm Specifies whether the command should be run in Confirm mode.
<CommonParameters> This cmdlet supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction, WarningVariable, OutBuffer, PipelineVariable, and OutVariable.

Inputs of Get-CimClass

The Get-CimClass command accepts the following input:

  • String – The name of the class to be retrieved.
  • String – The namespace of the class to be retrieved.
  • String[] – The name of the computer to be queried.
  • PSCredential – The credentials to be used to connect to the computer.
  • String – A filter to be used to limit the results.
  • String[] – The properties to be retrieved.
  • Uint32 – The timeout for the operation.
  • Boolean – Whether all privileges should be enabled.
  • AuthenticationLevel – The authentication level to be used.
  • ImpersonationLevel – The impersonation level to be used.
  • String – The locale to be used.
  • Int – The throttle limit to be used.
  • Boolean – Whether the command should be run as a job.
  • CimSession[] – The CIM session to be used.
  • ThrottleManager – The throttle manager to be used.
  • Boolean – Whether the command should be run in WhatIf mode.
  • Boolean – Whether the command should be run in Confirm mode.

Outputs of Get-CimClass

The Get-CimClass command returns the following output:

  • CimClass – An object representing the retrieved class.
  • CimInstance – An object representing the retrieved instance.

Examples of Get-CimClass

The following example retrieves the Win32_Process class from the root\cimv2 namespace:

Get-CimClass -ClassName Win32_Process -Namespace root\cimv2

The following example retrieves the Win32_Process class from the root\cimv2 namespace on the computer named MyComputer:

Get-CimClass -ClassName Win32_Process -Namespace root\cimv2 -ComputerName MyComputer

The following example retrieves the Win32_Process class from the root\cimv2 namespace on the computer named MyComputer, using the specified credentials:

Get-CimClass -ClassName Win32_Process -Namespace root\cimv2 -ComputerName MyComputer -Credential MyCredential

The following example retrieves the Win32_Process class from the root\cimv2 namespace on the computer named MyComputer, using the specified credentials, and retrieves only the specified properties:

Get-CimClass -ClassName Win32_Process -Namespace root\cimv2 -ComputerName MyComputer -Credential MyCredential -Property Name, ProcessId

Leave a Reply