Win32_NamedJobObjectLimitSetting

The Win32_NamedJobObjectLimitSetting WMI class represents the limit settings for a job object.

The Win32_NamedJobObjectLimitSetting WMI class represents the limit settings for a job object.

Methods

Win32_NamedJobObjectLimitSetting has no methods.

Properties

Win32_NamedJobObjectLimitSetting returns 14 properties:

'ActiveProcessLimit','Affinity','Caption','Description','JobMemoryLimit','LimitFlags',
'MaximumWorkingSetSize','MinimumWorkingSetSize','PerJobUserTimeLimit','PerProcessUserTimeLimit',
'PriorityClass','ProcessMemoryLimit','SchedulingClass','SettingID'

Unless explicitly marked as writeable, all properties are read-only. Read all properties for all instances:

Get-CimInstance -ClassName Win32_NamedJobObjectLimitSetting -Property *

Most WMI classes return one or more instances.

When Get-CimInstance returns no result, then apparently no instances of class Win32_NamedJobObjectLimitSetting exist. This is normal behavior.

Either the class is not implemented on your system (may be deprecated or due to missing drivers, i.e. CIM_VideoControllerResolution), or there are simply no physical representations of this class currently available (i.e. Win32_TapeDrive).

ActiveProcessLimit

UINT32

Active process limit for a job. If associating a process with a job causes the active process count to exceed the limit, the process is terminated and the association fails. This property is ignored unless the LimitFlags property specifies the Active Process Limit value.

Get-CimInstance -ClassName Win32_NamedJobObjectLimitSetting | Select-Object -Property SettingID, ActiveProcessLimit

Affinity

UINT32

Processor affinity for all of the processes associated with a job. The affinity of each thread is set to this value, but threads are free to set the affinity subsequently, when it is a subset of the specified affinity mask. Processes cannot set an affinity mask. This property is ignored unless LimitFlags specifies the Limit Affinity value.

Get-CimInstance -ClassName Win32_NamedJobObjectLimitSetting | Select-Object -Property SettingID, Affinity

Caption

STRING MAX 64 CHAR

Short textual description of the CIM_Setting object.

Get-CimInstance -ClassName Win32_NamedJobObjectLimitSetting | Select-Object -Property SettingID, Caption

Description

STRING

Textual description of the CIM_Setting object.

Get-CimInstance -ClassName Win32_NamedJobObjectLimitSetting | Select-Object -Property SettingID, Description

JobMemoryLimit

UINT32

Per-job memory limit in kilobytes. This property is ignored unless LimitFlags specifies the Limit Job Memory value.

Get-CimInstance -ClassName Win32_NamedJobObjectLimitSetting | Select-Object -Property SettingID, JobMemoryLimit

LimitFlags

UINT32

Bitmap that represents the job limits. One or more of the limits can be in effect at the same time.

1 (0x1)

Limit Working Set

Causes all of the processes associated with the job to use the same minimum and maximum working set sizes.

2 (0x2)

Limit Process Time

Establishes a user-mode execution time limit for each currently active process and all of the future processes associated with a job.

4 (0x4)

Limit Job Time

Establishes a user-mode execution time limit for the job. This flag cannot be used with Limit Preserve Job Time.

8 (0x8)

Active Process Limit

Establishes a maximum number of simultaneously active processes associated with the job.

16 (0x10)

Limit Affinity

Causes all of the processes associated with the job to use the same processor affinity.

32 (0x20)

Limit Priority Class

Causes all of the processes associated with a job to use the same priority class.

64 (0x40)

Limit Preserve Job Time

Preserves any job time limits you set previously. When this flag is set, you can establish a per-job time limit one time, then alter other limits in subsequent calls. This flag cannot be used with Limit Job Time.

128 (0x80)

Limit Scheduling Class

Causes all of the processes in a job to use the same scheduling class.

256 (0x100)

Limit Process Memory

Causes all of the processes associated with a job to limit their committed memory. When a process attempts to commit memory that exceeds the perprocess limit, it fails. If the job object is associated with a completion port, a JOB_OBJECT_MSG_PROCESS_MEMORY_LIMIT message is sent to the completion port.

512 (0x200)

Limit Job Memory

Causes all of the processes associated with a job to limit the job-wide sum of the committed memory. When a process attempts to commit memory that exceeds the job-wide limit, it fails. If the job object is associated with a completion port, a JOB_OBJECT_MSG_JOB_MEMORY_LIMIT message is sent to the completion port.

1024 (0x400)

Limit Die On Unhandled Exception

Forces a call to the SetErrorMode function with the SEM_NOGPFAULTERRORBOX flag for each process associated with a job.

2048 (0x800)

Limit Breakaway OK

If any of the process associated with a job creates a child process using the CREATE_BREAKAWAY_FROM_JOB flag while this limit is in effect, the child process is not associated with the job.

4096 (0x1000)

Silent Breakaway OK

Allows any process associated with a job to create child processes that are not associated with the job.

Get-CimInstance -ClassName Win32_NamedJobObjectLimitSetting | Select-Object -Property SettingID, LimitFlags

MaximumWorkingSetSize

UINT32

Maximum working set size for all of the processes associated with a job. This property is ignored unless LimitFlags specifies the Limit Working Set value.

Get-CimInstance -ClassName Win32_NamedJobObjectLimitSetting | Select-Object -Property SettingID, MaximumWorkingSetSize

MinimumWorkingSetSize

UINT32

Minimum working set size for all of the processes associated with a job. This property is ignored unless LimitFlags specifies the Limit Working Set value.

Get-CimInstance -ClassName Win32_NamedJobObjectLimitSetting | Select-Object -Property SettingID, MinimumWorkingSetSize

PerJobUserTimeLimit

UINT64 “100 NANOSECONDS”

Per-job user-mode execution time limit, in 100 nanosecond units. The system adds the current time of the processes associated with the job to this limit. For example, if you set this limit to 1 minute, and the job has a process that has accumulated 5 minutes of user mode time, the limit actually enforced is 6 minutes.

For more information about using uint64 values in scripts, see Scripting in WMI.

Get-CimInstance -ClassName Win32_NamedJobObjectLimitSetting | Select-Object -Property SettingID, PerJobUserTimeLimit

PerProcessUserTimeLimit

UINT64 “100 NANOSECONDS”

Per-process user-mode execution time limit, in 100-nanosecond units. This property is ignored unless LimitFlags specifies Limit Process Time. The system periodically checks to determine whether or not each process associated with the job has accumulated more user-mode time than the set limit. If it has, the process is terminated.

For more information about using uint64 values in scripts, see Scripting in WMI.

Get-CimInstance -ClassName Win32_NamedJobObjectLimitSetting | Select-Object -Property SettingID, PerProcessUserTimeLimit

PriorityClass

UINT32

Priority class for all of the processes associated with the job. Processes and threads cannot modify their priority class. This property is ignored unless LimitFlags specifies the Limit Priority value.

Get-CimInstance -ClassName Win32_NamedJobObjectLimitSetting | Select-Object -Property SettingID, PriorityClass

ProcessMemoryLimit

UINT32 “KILOBYTES”

Per-process memory limit in kilobytes. This property is ignored unless LimitFlags specifies the Limit Process Memory value.

Get-CimInstance -ClassName Win32_NamedJobObjectLimitSetting | Select-Object -Property SettingID, ProcessMemoryLimit

SchedulingClass

UINT32

Scheduling class for all of the processes associated with the job. The valid values are 0 (zero) to 9 (nine). Use 0 (zero) for the least favorable scheduling class relative to other threads, and 9 (nine) for the most favorable scheduling class relative to other threads. This property is ignored unless LimitFlags specifies the Limit Scheduling Class value.

Get-CimInstance -ClassName Win32_NamedJobObjectLimitSetting | Select-Object -Property SettingID, SchedulingClass

SettingID

KEY PROPERTY STRING

Job object limit setting instance. Because they are kernel objects, job object names are case-sensitive. However, Windows Management Instrumentation (WMI) keys are case-insensitive and must be decorated to distinguish case. To indicate a capital letter, precede the letter by a backslash. For example, “A” and “a” are lowercase and “\A” and “\a” are uppercase.

Get-CimInstance -ClassName Win32_NamedJobObjectLimitSetting | Select-Object -Property SettingID

Examples

List all instances of Win32_NamedJobObjectLimitSetting
Get-CimInstance -ClassName Win32_NamedJobObjectLimitSetting

Learn more about Get-CimInstance and the deprecated Get-WmiObject.

View all properties
Get-CimInstance -ClassName Win32_NamedJobObjectLimitSetting -Property *
View key properties only
Get-CimInstance -ClassName Win32_NamedJobObjectLimitSetting -KeyOnly

Selecting Properties

To select only some properties, pipe the results to Select-Object -Property a,b,c with a comma-separated list of the properties you require. Wildcards are permitted.

Get-CimInstance always returns all properties but only retrieves the ones that you specify. All other properties are empty but still present. That’s why you need to pipe the results into Select-Object if you want to limit the visible properties, i.e. for reporting.

Selecting Properties

The code below lists all available properties. Remove the ones you do not need:

$properties = 'ActiveProcessLimit',
              'Affinity',
              'Caption',
              'Description',
              'JobMemoryLimit',
              'LimitFlags',
              'MaximumWorkingSetSize',
              'MinimumWorkingSetSize',
              'PerJobUserTimeLimit',
              'PerProcessUserTimeLimit',
              'PriorityClass',
              'ProcessMemoryLimit',
              'SchedulingClass',
              'SettingID'
Get-CimInstance -ClassName Win32_NamedJobObjectLimitSetting | Select-Object -Property $properties
Limiting Network Bandwidth

If you work remotely, it makes sense to limit network bandwidth by filtering the properties on the server side, too:

Get-CimInstance -Class Win32_NamedJobObjectLimitSetting -Property $property | 
Select-Object -Property $property

Selecting Instances

To select some instances, use Get-CimInstance and a WMI Query. The wildcard character in WMI Queries is % (and not “*”).

The parameter -Filter runs a simple query.

Listing all instances where the property Caption starts with “A”
Get-CimInstance -Class Win32_NamedJobObjectLimitSetting -Filter 'Caption LIKE "a%"' 
Using a WQL Query

The parameter -Query uses a query similar to SQL and combines the parameters -Filter and -Property. This returns all instances where the property Caption starts with “A”, and returns the properties specified:

Get-CimInstance -Query "SELECT SettingID, MaximumWorkingSetSize, PerProcessUserTimeLimit, JobMemoryLimit FROM Win32_NamedJobObjectLimitSetting WHERE Caption LIKE 'a%'"

Any property you did not specify is still present but empty. You might need to use Select-Object to remove all unwanted properties:

Get-CimInstance -Query "SELECT SettingID, MaximumWorkingSetSize, PerProcessUserTimeLimit, JobMemoryLimit FROM Win32_NamedJobObjectLimitSetting WHERE Caption LIKE 'a%'" | Select-Object -Property SettingID, MaximumWorkingSetSize, PerProcessUserTimeLimit, JobMemoryLimit

Accessing Remote Computers

To access remote systems, you need to have proper permissions. User the parameter -ComputerName to access one or more remote systems.

Authenticating as Current User
# one or more computer names or IP addresses:
$list = 'server1', 'server2'

# authenticate with your current identity:
$result = Get-CimInstance -ClassName Win32_NamedJobObjectLimitSetting -ComputerName $list 
$result
Authenticating as Different User

Use a CIMSession object to authenticate with a new identity:

# one or more computer names or IP addresses:
$list = 'server1', 'server2'

# authenticate with a different identity:
$cred = Get-Credential -Message 'Authenticate to retrieve WMI information:'
$session = New-CimSession -ComputerName $list -Credential $cred

$result = Get-CimInstance Win32_NamedJobObjectLimitSetting -CimSession $session

# remove the session after use (if you do not plan to re-use it later)
Remove-CimSession -CimSession $session

$result

Learn more about accessing remote computers.

Requirements

To use Win32_NamedJobObjectLimitSetting, the following requirements apply:

PowerShell

Get-CimInstance was introduced with PowerShell Version 3.0, which in turn was introduced on clients with Windows 8 and on servers with Windows Server 2012.

If necessary, update Windows PowerShell to Windows PowerShell 5.1, or install PowerShell 7 side-by-side.

Operating System

Win32_NamedJobObjectLimitSetting was introduced on clients with Windows Vista and on servers with Windows Server 2008.

Namespace

Win32_NamedJobObjectLimitSetting lives in the Namespace Root/CIMV2. This is the default namespace. There is no need to use the -Namespace parameter in Get-CimInstance.

Implementation

Win32_NamedJobObjectLimitSetting is implemented in Wmipjobj.dll and defined in Wmipjobj.mof. Both files are located in the folder C:\Windows\system32\wbem:

explorer $env:windir\system32\wbem
notepad $env:windir\system32\wbem\Wmipjobj.mof