Main example
List instances
# All instances of Win32_Process, with the main properties
Get-CimInstance -ClassName Win32_Process |
Select-Object -Property @(
'ProcessId'
'Name'
'CommandLine'
'ParentProcessId'
@{ Name = 'WorkingSetSizeMB'; Expression = { [math]::Round($_.WorkingSetSize / 1MB, 2) } }
'CreationDate'
)Examples
Filter with WQL
# WQL filter evaluated by the provider: processes with this name
Get-CimInstance -ClassName Win32_Process -Filter "Name = 'powershell.exe'" |
Select-Object -Property @(
'ProcessId'
'Name'
'CommandLine'
'ParentProcessId'
@{ Name = 'WorkingSetSizeMB'; Expression = { [math]::Round($_.WorkingSetSize / 1MB, 2) } }
'CreationDate'
)The filter is evaluated by the WMI provider: less data is transferred than with Where-Object.
Decode numeric values
# Lookup table for ExecutionState (values documented by Microsoft)
$executionStateName = @{
0 = 'Unknown'
1 = 'Other'
2 = 'Ready'
3 = 'Running'
4 = 'Blocked'
5 = 'Suspended Blocked'
6 = 'Suspended Ready'
7 = 'Terminated'
8 = 'Stopped'
9 = 'Growing'
}
Get-CimInstance -ClassName Win32_Process |
Select-Object -Property @(
'ProcessId'
'Name'
'CommandLine'
'ParentProcessId'
@{ Name = 'WorkingSetSizeMB'; Expression = { [math]::Round($_.WorkingSetSize / 1MB, 2) } }
'CreationDate'
@{ Name = 'ExecutionState'; Expression = { $executionStateName[[int]$_.ExecutionState] } }
)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 {
Get-CimInstance -CimSession $cimSession -ClassName Win32_Process |
Select-Object -Property @(
'ProcessId'
'Name'
'CommandLine'
'ParentProcessId'
@{ Name = 'WorkingSetSizeMB'; Expression = { [math]::Round($_.WorkingSetSize / 1MB, 2) } }
'CreationDate'
)
} 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 Win32_Process
$cimClass.CimClassProperties |
Select-Object -Property Name, CimType, Flags
# Methods of the class
$cimClass.CimClassMethods |
Select-Object -Property Name, ReturnTypeProperties
| Name | Type | Access | Description | |||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Caption# | string | read | Short description of an object—a one-line string. Code | |||||||||||||||||||||||||||||||||||||||
| CommandLine# | string | read | Command line used to start a specific process, if applicable. Code | |||||||||||||||||||||||||||||||||||||||
| CreationClassName# key | string | read | Name of the class or subclass used in the creation of an instance. When used with other key properties of the class, this property allows all instances of the class and its subclasses to be uniquely identified. Code | |||||||||||||||||||||||||||||||||||||||
| CreationDate# | datetime | read | Date the process begins executing. Code | |||||||||||||||||||||||||||||||||||||||
| CSCreationClassName# key | string | read | Creation class name of the scoping computer system. Code | |||||||||||||||||||||||||||||||||||||||
| CSName# key | string | read | Name of the scoping computer system. Code | |||||||||||||||||||||||||||||||||||||||
| Description# | string | read | Description of an object. Code | |||||||||||||||||||||||||||||||||||||||
| ExecutablePath# | string | read | Path to the executable file of the process. Example: "C:\Windows\System\Explorer.Exe" Code | |||||||||||||||||||||||||||||||||||||||
| ExecutionState# | uint16 | read | Current operating condition of the process. Values (10)
Code | |||||||||||||||||||||||||||||||||||||||
| Handle# key | string | read | Process identifier. Code | |||||||||||||||||||||||||||||||||||||||
| HandleCount# | uint32 | read | Total number of open handles owned by the process. HandleCount is the sum of the handles currently open by each thread in this process. A handle is used to examine or modify the system resources. Each handle has an entry in a table that is maintained internally. Entries contain the addresses of the resources and data to identify the resource type. Code | |||||||||||||||||||||||||||||||||||||||
| InstallDate# | datetime | read | Date an object is installed. The object may be installed without a value being written to this property. Code | |||||||||||||||||||||||||||||||||||||||
| KernelModeTime# | uint64 | read | Time in kernel mode, in milliseconds. If this information is not available, use a value of 0 (zero). For more information about using uint64 values in scripts, see Scripting in WMI. Unit: 100 nanoseconds Code | |||||||||||||||||||||||||||||||||||||||
| MaximumWorkingSetSize# | uint32 | read | Maximum working set size of the process. The working set of a process is the set of memory pages visible to the process in physical RAM. These pages are resident, and available for an application to use without triggering a page fault. Example: 1413120 Unit: kilobytes Code | |||||||||||||||||||||||||||||||||||||||
| MinimumWorkingSetSize# | uint32 | read | Minimum working set size of the process. The working set of a process is the set of memory pages visible to the process in physical RAM. These pages are resident and available for an application to use without triggering a page fault. Example: 20480 Unit: kilobytes Code | |||||||||||||||||||||||||||||||||||||||
| Name# | string | read | Name of the executable file responsible for the process, equivalent to the Image Name property in Task Manager. When inherited by a subclass, the property can be overridden to be a key property. The name is hard-coded into the application itself and is not affected by changing the file name. For example, even if you rename Calc.exe, the name Calc.exe will still appear in Task Manager and in any WMI scripts that retrieve the process name. Code | |||||||||||||||||||||||||||||||||||||||
| OSCreationClassName# key | string | read | Creation class name of the scoping operating system. Code | |||||||||||||||||||||||||||||||||||||||
| OSName# key | string | read | Name of the scoping operating system. Code | |||||||||||||||||||||||||||||||||||||||
| OtherOperationCount# | uint64 | read | Number of I/O operations performed that are not read or write operations. For more information about using uint64 values in scripts, see Scripting in WMI. Code | |||||||||||||||||||||||||||||||||||||||
| OtherTransferCount# | uint64 | read | Amount of data transferred during operations that are not read or write operations. For more information about using uint64 values in scripts, see Scripting in WMI. Unit: bytes Code | |||||||||||||||||||||||||||||||||||||||
| PageFaults# | uint32 | read | Number of page faults that a process generates. Example: 10 Code | |||||||||||||||||||||||||||||||||||||||
| PageFileUsage# | uint32 | read | Amount of page file space that a process is using currently. This value is consistent with the VMSize value in TaskMgr.exe. Example: 102435 Unit: kilobytes Code | |||||||||||||||||||||||||||||||||||||||
| ParentProcessId# | uint32 | read | Unique identifier of the process that creates a process. Process identifier numbers are reused, so they only identify a process for the lifetime of that process. It is possible that the process identified by ParentProcessId is terminated, so ParentProcessId may not refer to a running process. It is also possible that ParentProcessId incorrectly refers to a process that reuses a process identifier. You can use the CreationDate property to determine whether the specified parent was created after the process represented by this Win32_Process instance was created. Code | |||||||||||||||||||||||||||||||||||||||
| PeakPageFileUsage# | uint32 | read | Maximum amount of page file space used during the life of a process. Example: 102367 Unit: kilobytes Code | |||||||||||||||||||||||||||||||||||||||
| PeakVirtualSize# | uint64 | read | Maximum virtual address space a process uses at any one time. Using virtual address space does not necessarily imply corresponding use of either disk or main memory pages. However, virtual space is finite, and by using too much the process might not be able to load libraries. For more information about using uint64 values in scripts, see Scripting in WMI. Unit: bytes Code | |||||||||||||||||||||||||||||||||||||||
| PeakWorkingSetSize# | uint32 | read | Peak working set size of a process. Example: 1413120 Unit: kilobytes Code | |||||||||||||||||||||||||||||||||||||||
| Priority# | uint32 | read | Scheduling priority of a process within an operating system. The higher the value, the higher priority a process receives. Priority values can range from 0 (zero), which is the lowest priority to 31, which is highest priority. Example: 7 Code | |||||||||||||||||||||||||||||||||||||||
| PrivatePageCount# | uint64 | read | Current number of pages allocated that are only accessible to the process represented by this Win32_Process instance. For more information about using uint64 values in scripts, see Scripting in WMI. Code | |||||||||||||||||||||||||||||||||||||||
| ProcessId# | uint32 | read | Numeric identifier used to distinguish one process from another. ProcessIDs are valid from process creation time to process termination. Upon termination, that same numeric identifier can be applied to a new process. This means that you cannot use ProcessID alone to monitor a particular process. For example, an application could have a ProcessID of 7, and then fail. When a new process is started, the new process could be assigned ProcessID 7. A script that checked only for a specified ProcessID could thus be "fooled" into thinking that the original application was still running. Code | |||||||||||||||||||||||||||||||||||||||
| QuotaNonPagedPoolUsage# | uint32 | read | Quota amount of nonpaged pool usage for a process. Example: 15 Code | |||||||||||||||||||||||||||||||||||||||
| QuotaPagedPoolUsage# | uint32 | read | Quota amount of paged pool usage for a process. Example: 22 Code | |||||||||||||||||||||||||||||||||||||||
| QuotaPeakNonPagedPoolUsage# | uint32 | read | Peak quota amount of nonpaged pool usage for a process. Example: 31 Code | |||||||||||||||||||||||||||||||||||||||
| QuotaPeakPagedPoolUsage# | uint32 | read | Peak quota amount of paged pool usage for a process. Example: 31 Code | |||||||||||||||||||||||||||||||||||||||
| ReadOperationCount# | uint64 | read | Number of read operations performed. For more information about using uint64 values in scripts, see Scripting in WMI. Code | |||||||||||||||||||||||||||||||||||||||
| ReadTransferCount# | uint64 | read | Amount of data read. For more information about using uint64 values in scripts, see Scripting in WMI. Unit: bytes Code | |||||||||||||||||||||||||||||||||||||||
| SessionId# | uint32 | read | Unique identifier that an operating system generates when a session is created. A session spans a period of time from logon until logoff from a specific system. Code | |||||||||||||||||||||||||||||||||||||||
| Status# | string | read | This property is not implemented and does not get populated for any instance of this class. It is always NULL. Values include the following: Values (12)
Code | |||||||||||||||||||||||||||||||||||||||
| TerminationDate# | datetime | read | Process was stopped or terminated. To get the termination time, a handle to the process must be held open. Otherwise, this property returns NULL. Code | |||||||||||||||||||||||||||||||||||||||
| ThreadCount# | uint32 | read | Number of active threads in a process. An instruction is the basic unit of execution in a processor, and a thread is the object that executes an instruction. Each running process has at least one thread. Code | |||||||||||||||||||||||||||||||||||||||
| UserModeTime# | uint64 | read | Time in user mode, in 100 nanosecond units. If this information is not available, use a value of 0 (zero). For more information about using uint64 values in scripts, see Scripting in WMI. Unit: 100 nanoseconds Code | |||||||||||||||||||||||||||||||||||||||
| VirtualSize# | uint64 | read | Current size of the virtual address space that a process is using, not the physical or virtual memory actually used by the process. Using virtual address space does not necessarily imply corresponding use of either disk or main memory pages. Virtual space is finite, and by using too much, the process might not be able to load libraries. This value is consistent with what you see in Perfmon.exe. For more information about using uint64 values in scripts, see Scripting in WMI. Unit: bytes Code | |||||||||||||||||||||||||||||||||||||||
| WindowsVersion# | string | read | Version of Windows in which the process is running. Example: 4.0 Code | |||||||||||||||||||||||||||||||||||||||
| WorkingSetSize# | uint64 | read | Amount of memory in bytes that a process needs to execute efficiently—for an operating system that uses page-based memory management. If the system does not have enough memory (less than the working set size), thrashing occurs. If the size of the working set is not known, use NULL or 0 (zero). If working set data is provided, you can monitor the information to understand the changing memory requirements of a process. For more information about using uint64 values in scripts, see Scripting in WMI. Unit: bytes Code | |||||||||||||||||||||||||||||||||||||||
| WriteOperationCount# | uint64 | read | Number of write operations performed. For more information about using uint64 values in scripts, see Scripting in WMI. Code | |||||||||||||||||||||||||||||||||||||||
| WriteTransferCount# | uint64 | read | Amount of data written. For more information about using uint64 values in scripts, see Scripting in WMI. Unit: bytes Code |
Methods
AttachDebugger #
Launches the currently registered debugger for a process.
uint32 AttachDebugger();Return values
| Value | Label | Description |
|---|---|---|
| 0 | Successful completion | |
| 2 | Access denied | The user does not have access to the requested information. |
| 3 | Insufficient privilege | The user does not have sufficient privilege. |
| 8 | Unknown failure | |
| 9 | Path not found | The path specified does not exist. |
| 21 | Invalid parameter | The specified parameter is not valid. |
| 22..4294967295 | Other |
Call the AttachDebugger method
review before running# Warning: this method can change the system. -WhatIf shows the operation without running it.
# Target instance
$instance = Get-CimInstance -ClassName Win32_Process -Filter "Name = 'notepad.exe'"
$methodParameters = @{
InputObject = $instance
MethodName = 'AttachDebugger'
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) {
$returnValueName = @{
0 = 'Successful completion'
2 = 'Access denied'
3 = 'Insufficient privilege'
8 = 'Unknown failure'
9 = 'Path not found'
21 = 'Invalid parameter'
}
$returnValueName[[int]$result.ReturnValue]
}This method can change the system. The -WhatIf parameter shows the operation without running it: remove it only after checking.
Create static#
Creates a new process.
uint32 Create(
[in] string CommandLine,
[in] string CurrentDirectory,
[in] Win32_ProcessStartup ProcessStartupInformation,
[out] uint32 ProcessId
);Parameters
| Parameter | Type | Direction | Description |
|---|---|---|---|
| CommandLine | string | in | Command line to execute. The system adds a null character to the command line, trimming the string if necessary, to indicate which file was actually used. |
| CurrentDirectory | string | in | Current drive and directory for the child process. The string requires that the current directory resolves to a known path. A user can specify an absolute path or a path relative to the current working directory. If this parameter is NULL, the new process will have the same path as the calling process. This option is provided primarily for shells that must start an application and specify the application's initial drive and working directory. |
| ProcessStartupInformation | Win32_ProcessStartup | in | The startup configuration of a Windows process. For more information, see Win32_ProcessStartup. |
| ProcessId | uint32 | out | Global process identifier that can be used to identify a process. The value is valid from the time the process is created until the time the process is terminated. |
Return values
| Value | Label | Description |
|---|---|---|
| 0 | Successful completion | |
| 2 | Access denied | |
| 3 | Insufficient privilege | |
| 8 | Unknown failure | |
| 9 | Path not found | |
| 21 | Invalid parameter | |
| 22..4294967295 | Other |
Call the Create method
review before running# Warning: this method can change the system. -WhatIf shows the operation without running it.
$methodParameters = @{
ClassName = 'Win32_Process'
MethodName = 'Create'
Arguments = @{
CommandLine = 'notepad.exe'
CurrentDirectory = 'Example'
ProcessStartupInformation = $null
}
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) {
$returnValueName = @{
0 = 'Successful completion'
2 = 'Access denied'
3 = 'Insufficient privilege'
8 = 'Unknown failure'
9 = 'Path not found'
21 = 'Invalid parameter'
}
$returnValueName[[int]$result.ReturnValue]
$result.ProcessId
}This method can change the system. The -WhatIf parameter shows the operation without running it: remove it only after checking.
GetAvailableVirtualSize #
Retrieves the current size, in bytes, of the free virtual address space available to the process. Windows Server 2012, Windows 8, Windows 7, Windows Server 2008 and Windows Vista: This method is not supported before Windows 8.1 and Windows Server 2012 R2.
uint32 GetAvailableVirtualSize([out] uint64 AvailableVirtualSize);Parameters
| Parameter | Type | Direction | Description |
|---|---|---|---|
| AvailableVirtualSize | uint64 | out | The *AvailableVirtualSize* parameter returns the free virtual address space available to this process. |
Return values
| Value | Label | Description |
|---|---|---|
| 0 | Successful completion | The operation completed successfully. |
| 2 | Access denied | The user does not have access to the requested information |
| 3 | Insufficient privilege | The user does not have sufficient privilege. |
| 8 | Unknown failure | |
| 9 | Path not found | The path specified does not exist. |
| 21 | Invalid parameter | The specified parameter is invalid. |
| 22..4294967295 | Other | For values other than those listed, refer to the System Error Codes documentation. |
Call the GetAvailableVirtualSize method
review before running# Warning: this method can change the system. -WhatIf shows the operation without running it.
# Target instance
$instance = Get-CimInstance -ClassName Win32_Process -Filter "Name = 'notepad.exe'"
$methodParameters = @{
InputObject = $instance
MethodName = 'GetAvailableVirtualSize'
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) {
$returnValueName = @{
0 = 'Successful completion'
2 = 'Access denied'
3 = 'Insufficient privilege'
8 = 'Unknown failure'
9 = 'Path not found'
21 = 'Invalid parameter'
}
$returnValueName[[int]$result.ReturnValue]
$result.AvailableVirtualSize
}This method can change the system. The -WhatIf parameter shows the operation without running it: remove it only after checking.
GetOwner #
Retrieves the user name and domain name under which the process is running.
uint32 GetOwner([out] string User, [out] string Domain);Parameters
| Parameter | Type | Direction | Description |
|---|---|---|---|
| User | string | out | Returns the user name of the owner of this process. |
| Domain | string | out | Returns the domain name under which this process is running. |
Return values
| Value | Label | Description |
|---|---|---|
| 0 | Successful completion | |
| 2 | Access denied | |
| 3 | Insufficient privilege | |
| 8 | Unknown failure | |
| 9 | Path not found | |
| 21 | Invalid parameter | |
| 22..4294967295 | Other |
Call the GetOwner method
review before running# Warning: this method can change the system. -WhatIf shows the operation without running it.
# Target instance
$instance = Get-CimInstance -ClassName Win32_Process -Filter "Name = 'notepad.exe'"
$methodParameters = @{
InputObject = $instance
MethodName = 'GetOwner'
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) {
$returnValueName = @{
0 = 'Successful completion'
2 = 'Access denied'
3 = 'Insufficient privilege'
8 = 'Unknown failure'
9 = 'Path not found'
21 = 'Invalid parameter'
}
$returnValueName[[int]$result.ReturnValue]
$result.User
$result.Domain
}This method can change the system. The -WhatIf parameter shows the operation without running it: remove it only after checking.
GetOwnerSid #
Retrieves the security identifier (SID) for the owner of a process.
uint32 GetOwnerSid([out] string Sid);Parameters
| Parameter | Type | Direction | Description |
|---|---|---|---|
| Sid | string | out | Returns the security identifier descriptor for this process. |
Return values
| Value | Label | Description |
|---|---|---|
| 0 | Successful completion | |
| 2 | Access denied | |
| 3 | Insufficient privilege | |
| 8 | Unknown failure | |
| 9 | Path not found | |
| 21 | Invalid parameter | |
| 22..4294967295 | Other |
Call the GetOwnerSid method
review before running# Warning: this method can change the system. -WhatIf shows the operation without running it.
# Target instance
$instance = Get-CimInstance -ClassName Win32_Process -Filter "Name = 'notepad.exe'"
$methodParameters = @{
InputObject = $instance
MethodName = 'GetOwnerSid'
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) {
$returnValueName = @{
0 = 'Successful completion'
2 = 'Access denied'
3 = 'Insufficient privilege'
8 = 'Unknown failure'
9 = 'Path not found'
21 = 'Invalid parameter'
}
$returnValueName[[int]$result.ReturnValue]
$result.Sid
}This method can change the system. The -WhatIf parameter shows the operation without running it: remove it only after checking.
SetPriority #
Changes the execution priority of a process.
uint32 SetPriority([in] sint32 Priority);Parameters
| Parameter | Type | Direction | Description |
|---|---|---|---|
| Priority | sint32 | in | New priority class for the process. Note that these values are different than those explicitly stated in the Priority property of Win32_Process. |
Return values
| Value | Label | Description |
|---|---|---|
| 0 | Successful completion | |
| 2 | Access denied | |
| 3 | Insufficient privilege | |
| 8 | Unknown failure | |
| 9 | Path not found | |
| 21 | Invalid parameter | |
| 22..4294967295 | Other |
Call the SetPriority method
review before running# Warning: this method can change the system. -WhatIf shows the operation without running it.
# Target instance
$instance = Get-CimInstance -ClassName Win32_Process -Filter "Name = 'notepad.exe'"
$methodParameters = @{
InputObject = $instance
MethodName = 'SetPriority'
Arguments = @{ Priority = 32 }
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) {
$returnValueName = @{
0 = 'Successful completion'
2 = 'Access denied'
3 = 'Insufficient privilege'
8 = 'Unknown failure'
9 = 'Path not found'
21 = 'Invalid parameter'
}
$returnValueName[[int]$result.ReturnValue]
}This method can change the system. The -WhatIf parameter shows the operation without running it: remove it only after checking.
Terminate #
Terminates a process and all of its threads.
uint32 Terminate([in] uint32 Reason);Parameters
| Parameter | Type | Direction | Description |
|---|---|---|---|
| Reason | uint32 | in | Exit code for the process and for all of the threads terminated as a result of this call. |
Return values
| Value | Label | Description |
|---|---|---|
| 0 | Successful completion | |
| 2 | Access denied | |
| 3 | Insufficient privilege | |
| 8 | Unknown failure | |
| 9 | Path not found | |
| 21 | Invalid parameter | |
| 22..4294967295 | Other |
Call the Terminate method
review before running# Warning: this method can change the system. -WhatIf shows the operation without running it.
# Target instance
$instance = Get-CimInstance -ClassName Win32_Process -Filter "Name = 'notepad.exe'"
$methodParameters = @{
InputObject = $instance
MethodName = 'Terminate'
Arguments = @{ Reason = 1 }
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) {
$returnValueName = @{
0 = 'Successful completion'
2 = 'Access denied'
3 = 'Insufficient privilege'
8 = 'Unknown failure'
9 = 'Path not found'
21 = 'Invalid parameter'
}
$returnValueName[[int]$result.ReturnValue]
}This method can change the system. The -WhatIf parameter shows the operation without running it: remove it only after checking.
Remarks
The Win32_Process class is derived from CIM_Process. The calling process that uses this class must have the SE_RESTORE_NAME privilege on the computer in which the registry resides. For more information, see Executing Privileged Operations.
### Overview
Processes underlie almost everything that happens on a computer. In fact, the root cause of most computer problems can be traced to processes; for example, too many processes might be running on a computer (and contending for a finite set of resources), or a single process might be using more than its share of resources. These factors make it important to keep a close watch on the processes running on a computer. Process monitoring, the main activity in process management, allows you to determine what a computer actually does, what applications the computer runs, and how those applications are affected by changes in the computing environment.
### Monitoring a Process
Monitoring processes on a regular basis helps you ensure that a computer runs at peak efficiency and that it carries out its appointed tasks as expected. For example, by monitoring processes you can be notified immediately of any application that has stopped responding, and then take steps to end that process. In addition, process monitoring enables you to identify problems before they occur. For example, by repeatedly checking the amount of memory used by a process, you can identify a memory leak. You can then stop the process before the errant application uses all of the available memory and brings the computer to a halt.
Process monitoring also helps minimize the disruptions caused by planned outages for upgrades and maintenance. For example, by checking the status of a database application running on client computers, you can determine the impact of taking the database offline in order to upgrade the software.
Monitoring process availability. Measures the percentage of time that a process is available. Availability is typically monitored by use of a simple probe, which reports whether the process is still running. By keeping track of the results of each probe, you can calculate the availability of the process. For example, a process that is probed 100 times and responds on 95 of those occasions has an availability of 95 percent. This type of monitoring is typically reserved for databases, mail programs, and other applications that are expected to run at all times. It is not appropriate for word processing programs, spreadsheets, or other applications that are routinely started and stopped several times a day.
You can create an instance of the Win32_ProcessStartup class to configure the process.
You can monitor process performance with the Win32_PerfFormattedData_PerfProc_Process class and a WMI refresher object, such as SWbemRefresher. For more information, see Monitoring Performance Data.
Inheritance
Superclass chain
Known subclasses
No known subclass.
Requirements
- Namespace
- root/cimv2
- Minimum client
- Windows Vista
- Minimum server
- Windows Server 2008
- Provider
- CIMWin32
- MOF file
- CIMWin32.mof
- DLL
- CIMWin32.dll
Class qualifiers
Dynamic Provider("CIMWin32") SupportsCreate CreateBy("Create") SupportsDelete DeleteBy("DeleteInstance") UUID("{8502C4DC-5FBB-11D2-AAC1-006008C78BC7}") DisplayName("Processes") AMENDMENT
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.