A logical element that represents an executing unit of work, such as a script or a print job. A Job is distinct from a Process in that a Job can be scheduled or queued, and its execution is not limited to a single system.
The following syntax is simplified from Managed Object Format (MOF) code and includes all of the inherited properties.
Syntax
[UMLPackagePath("CIM::Core::CoreElements"), Abstract, Version("2.10.0"), AMENDMENT]
class CIM_Job : CIM_LogicalElement
{
string InstanceID;
string Caption;
string Description;
string ElementName;
datetime InstallDate;
string Name;
uint16 OperationalStatus[];
string StatusDescriptions[];
string Status;
uint16 HealthState;
uint16 CommunicationStatus;
uint16 DetailedStatus;
uint16 OperatingStatus;
uint16 PrimaryStatus;
string JobStatus;
datetime TimeSubmitted;
datetime ScheduledStartTime;
datetime StartTime;
datetime ElapsedTime;
uint32 JobRunTimes = 1;
uint8 RunMonth;
sint8 RunDay;
sint8 RunDayOfWeek;
datetime RunStartInterval;
uint16 LocalOrUtcTime;
datetime UntilTime;
string Notify;
string Owner;
uint32 Priority;
uint16 PercentComplete;
boolean DeleteOnCompletion;
uint16 ErrorCode;
string ErrorDescription;
uint16 RecoveryAction;
string OtherRecoveryAction;
};
Members
The CIM_Job class has these types of members:
Methods
The CIM_Job class has these methods.
| Method | Description |
|---|---|
| KillJob | KillJob is being deprecated because there is no distinction made between an orderly shutdown and an immediate kill. |
Properties
The CIM_Job class has these properties.
Caption
Data type: string
Access type: Read-only
Qualifiers: MaxLen (64)
Contains a short textual description of the object.
This property is inherited from CIM_ManagedElement.
CommunicationStatus
Data type: uint16
Access type: Read-only
Indicates the ability of the instrumentation to communicate with this element. A NULL value indicates that instrumentation does not support this property.
This property is inherited from CIM_ManagedSystemElement.
| Values | Meaning |
|---|---|
| Unknown 0 | Indicates that the instrumentation cannot report on the CommunicationStatus property at this time. |
| Not Available 1 | Indicates that the instrumentation is capable of reporting this property, but intentionally does not for this element. |
| Communication OK 2 | Indicates only that communication is established with the element. |
| Lost Communication 3 | Indicates that the element has been contacted in the past, but is currently unreachable. |
| No Contact 4 | Indicates that the instrumentation has contact information for this element, but has never been able to communicate with it. |
| DMTF Reserved 5 32767 | Reserved. |
| Vendor Reserved 32768 = value | Reserved. |
DeleteOnCompletion
Data type: boolean
Access type: Read/write
Indicates whether or not the job should be automatically deleted upon completion. Note that the 'completion' of a recurring job is defined by its JobRunTimes or UntilTime properties, or when the Job is terminated by manual intervention. If this property is set to false and the job completes, then the extrinsic method DeleteInstance must be used to delete the job instead of updating this property.
Description
Data type: string
Access type: Read-only
Provides a textual description of the object.
This property is inherited from CIM_ManagedElement.
DetailedStatus
Data type: uint16
Access type: Read-only
Qualifiers: ModelCorrespondence ("CIM_EnabledLogicalElement.PrimaryStatus", "CIM_ManagedSystemElement.HealthState")
Indicates additional status details that complement the PrimaryStatus property. A NULL value indicates that the instrumentation does not support this property.
This property is inherited from CIM_ManagedSystemElement.
| Values | Meaning |
|---|---|
| Not Available 0 | Indicates that the instrumentation is capable of reporting this property, but intentionally does not report it for this element. |
| No Additional Information 1 | Indicates that no details have to be added to the PrimaryStatus property, for example when the PrimaryStatus is set to OK. |
| Stressed 2 | Indicates that the element functions, but requires attention. Overload and overheated are examples of Stressed states. |
| Predictive Failure 3 | Indicates that an element functions nominally, but predicts a failure in the near future. |
| Non-Recoverable Error 4 | Indicates that this element is in an error condition that requires human intervention. |
| Supporting Entity in Error 5 | Indicates that an element on which this element depends is in error. This element might be OK but cannot function because of the state of a dependent element. An example is a network service or endpoint that cannot function due to lower-layer networking problems. |
| DMTF Reserved 6 32767 | Reserved. |
| Vendor Reserved 32768 = value | Reserved. |
ElapsedTime
Data type: datetime
Access type: Read-only
The time interval that the Job has been executing or the total execution time if the Job is complete. Note that this property is also present in the JobProcessingStatistics class. This class is necessary to capture the processing information for recurring Jobs, because only the 'last' run time can be stored in this single-valued property.
ElementName
Data type: string
Access type: Read-only
Contains a user-friendly name for the object. This property allows each instance to define a user-friendly name in addition to its key properties, identity data, and description information.
This property is inherited from CIM_ManagedElement.
ErrorCode
Data type: uint16
Access type: Read-only
Qualifiers: ModelCorrespondence ("CIM_Job.ErrorDescription")
A vendor-specific error code. The value must be set to zero if the Job completed without error. Note that this property is also present in the JobProcessingStatistics class. This class is necessary to capture the processing information for recurring Jobs, because only the 'last' run error can be stored in this single-valued property.
ErrorDescription
Data type: string
Access type: Read-only
Qualifiers: ModelCorrespondence ("CIM_Job.ErrorCode")
A free-form string that contains the vendor error description. Note that this property is also present in the JobProcessingStatistics class. This class is necessary to capture the processing information for recurring Jobs, because only the 'last' run error can be stored in this single-valued property.
HealthState
Data type: uint16
Access type: Read-only
Indicates the current health of the element. This attribute expresses the health of this element but not necessarily that of its sub-components.
This property is inherited from CIM_ManagedSystemElement.
| Values | Meaning |
|---|---|
| Unknown 0 | The implementation cannot report on HealthState at this time. |
| OK 5 | The element is fully functional and is operating within normal operational parameters and without error. |
| Degraded/Warning 10 | The element is in working order and all functionality is provided. However, the element is not working to the best of its abilities. For example, the element might not be operating at optimal performance or it might be reporting recoverable errors |
| Minor failure 15 | All functionality is available but some might be degraded. |
| Major failure 20 | The element is failing. It is possible that some or all of the functionality of this component is degraded or not working. |
| Critical failure 25 | The element is non-functional and recovery might not be possible. |
| Non-recoverable error 30 | The element has completely failed, and recovery is not possible. All functionality provided by this element has been lost. |
| DMTF Reserved 31 = value | DMTF has reserved the unused portion of the continuum for additional HealthStates values in the future. |
InstallDate
Data type: datetime
Access type: Read-only
Indicates when the object was installed. The lack of a value does not indicate that the object is not installed.
This property is inherited from CIM_ManagedSystemElement.
InstanceID
Data type: string
Access type: Read-only
Uniquely and opaquely identifies an instance of this class within the scope of the containing Namespace.
[!Important]In order to ensure uniqueness within the Namespace, the value of InstanceID should be constructed in the following pattern:
OrgID:LocalID
OrgID must include a copyrighted, trademarked or otherwise unique name that is owned by the business entity defining the InstanceID, or be a registered ID that is assigned by a recognized global authority. This is similar to the structure of Schema class names. In addition, to ensure uniqueness the first colon in InstanceID must be between the OrgID andLocalID. Therefore the OrgID must not contain a colon (':').
LocalID is chosen by the business entity and should not be re-used to identify different underlying real-world elements.
If the preceding pattern is not used, the defining entity must assure that the resultant InstanceID is not re-used across any InstanceIDs produced by this or other providers for this Namespace.
For Distributed Management Task Force (DMTF) defined instances, the pattern must be used with the OrgID set to CIM.
This property is inherited from CIM_ManagedElement.
JobRunTimes
Data type: uint32
Access type: Read/write
The number of times that the Job should be run. A value of 1 indicates that the Job is not recurring, while any non-zero value indicates a limit to the number of times that the Job will recur. Zero indicates that there is no limit to the number of times that the Job can be processed, but that it is terminated either after the UntilTime or by manual intervention. By default, a Job is processed once.
JobStatus
Data type: string
Access type: Read-only
Qualifiers: ModelCorrespondence ("CIM_ManagedSystemElement.OperationalStatus")
A free-form string that represents the status of the job. The primary status is reflected in the inherited OperationalStatus property. JobStatus provides additional, implementation-specific details.
LocalOrUtcTime
Data type: uint16
Access type: Read/write
This property indicates whether the times represented in the RunStartInterval and UntilTime properties represent local times or UTC times. Time values are synchronized worldwide by using the enumeration value 2, "UTC Time".
Local Time (1)
UTC Time (2)
Name
Data type: string
Access type: Read-only
Qualifiers: MaxLen (1024)
Indicates the user-friendly name for this instance of a job. In addition, the user-friendly name can be used as a property for a search or query.
[!Tip]
Name does not have to be unique within a namespace.
This property is inherited from CIM_ManagedSystemElement.
Notify
Data type: string
Access type: Read/write
The User who is to be notified upon the Job completion or failure.
OperatingStatus
Data type: uint16
Access type: Read-only
Qualifiers: ModelCorrespondence ("CIM_EnabledLogicalElement.EnabledState")
Indicates the current operational condition of the element. This property can be used to provide more detail about the current state of the element. It can also indicate transitional states. A NULL value indicates that the instrumentation does not support this property.
This property is inherited from CIM_ManagedSystemElement.
| Value | Meaning |
|---|---|
| Unknown 0 | Indicates that the instrumentation cannot report on the OperatingStatus property at this time. |
| Not Available 1 | Indicates that the instrumentation is capable of reporting this property, but intentionally does not report it for this element. |
| Servicing 2 | Indicates that the element is in process to be configured, maintained, cleaned, or otherwise administered. |
| Starting 3 | Indicates that the element is being initialized. |
| Stopping 4 | Indicates that the element is being brought to an orderly stop. |
| Stopped 5 | Indicates that the element is intentionally stopped. |
| Aborted 6 | Indicates that the element stopped in an unexpected way. |
| Dormant 7 | Indicates that the element is inactive or quiesced. |
| Completed 8 | Indicates that the element completed its operation. We recommend using a PrimaryStatus property value of OK, Error, or Degraded to indicate success or failure of the operation. |
| Migrating 9 | Indicates that the element is being moved between host elements. |
| Emigrating 10 | Indicates that the element is being moved away from the host element. |
| Immigrating 11 | Indicates that the element is being moved to a new host element. |
| Snapshotting 12 | Indicates that a snapshot copy of the element is being created. |
| Shutting Down 13 | Indicates that the element is being brought to an abrupt stop. |
| In Test 14 | Indicates that the element is performing test functions. |
| Transitioning 15 | Indicates that the element is between states and is not fully available in either state. Use another value that indicates a more specific transition if one is available. |
| In Service 16 | Indicates that the element is in service and operational. |
| DMTF Reserved 17 32767 | Reserved. |
| Vendor Reserved 32768 = value | Reserved. |
OperationalStatus
Data type: uint16 array
Access type: Read-only
Qualifiers: ArrayType ("Indexed"), ModelCorrespondence ("CIM_ManagedSystemElement.StatusDescriptions")
Contains indicators of the current status of the element. The first value of OperationalStatus should contain the primary status for the element.
Note:
OperationalStatus replaces the deprecated Status property. Due to the widespread use of the existing Status property in management applications, Microsoft strongly recommends that providers or instrumentation provide both the Status and OperationalStatus properties. When instrumented, Status (because it is single-valued) should also provide the primary status of the element.
This property is inherited from CIM_ManagedSystemElement.
| Values | Meaning |
|---|---|
| Unknown 0 | Indicates the implementation cannot report on OperationalStatus at this time. |
| Other 1 | Indicates an undefined state. |
| OK 2 | Indicates full functionality without errors. |
| Degraded 3 | Indicates the element is working and all functionality is provided. However, the element is not working to the best of its abilities. For example, the element might not be operating at optimal performance or it might be reporting recoverable errors |
| Stressed 4 | Indicates that the element is functioning, but needs attention. Overload and overheated are examples of Stressed states. |
| Predictive Failure 5 | Indicates that an element is functioning nominally but predicting a failure in the near future. |
| Error 6 | Indicates that an error has occurred. |
| Non-Recoverable Error 7 | A nonrecoverable error has occurred. |
| Starting 8 | The job is starting. |
| Stopping 9 | The job is stopping. |
| Stopped 10 | The element has been intentionally stopped. |
| In Service 11 | Indicates the element is being configured, maintained, cleaned, or otherwise administered. |
| No Contact 12 | Indicates that the monitoring system has knowledge of this element, but has never been able to establish communications with it. |
| Lost Communication 13 | Indicates that the job is known to exist and has been contacted successfully in the past, but is currently unreachable. |
| Aborted 14 | Indicates the job stopped in an unexpected way. The state and configuration of the job might need to be updated. |
| Dormant 15 | Indicates that the job is inactive. |
| Supporting Entity in Error 16 | Indicates that an element on which this job depends is in error. This element may be OK but is unable to function because of the state of a dependent element. An example is a network service or endpoint that cannot function due to lower-layer networking problems. |
| Completed 17 | Indicates that the job has completed its operation. This value should be combined with either OK, ErrorError, or Degraded so that a client can tell if the complete operation Completed with OK (passed), Completed with Error (failed), or Completed with Degraded (the operation finished, but it did not complete OK or did not report an error). |
| Power Mode 18 | "Power Mode" indicates that the element has additional power model information contained in the associated PowerManagementService association. |
| DMTF Reserved 19 32767 | DMTF has reserved this portion of the range for additional OperationalStatus values in the future. |
| Vendor Reserved 32768 65535 | Microsoft has reserved the unused portion of the range for additional OperationalStatus values in the future. |
OtherRecoveryAction
Data type: string
Access type: Read-only
Qualifiers: ModelCorrespondence ("CIM_Job.RecoveryAction")
A string describing the recovery action when the RecoveryAction property of the instance is 1 ("Other").
Owner
Data type: string
Access type: Read-only
Qualifiers: ModelCorrespondence ("CIM_OwningJobElement")
The User that submitted the Job, or the Service or method name that caused the job to be created.
PercentComplete
Data type: uint16
Access type: Read-only
Qualifiers: MinValue ("0"), MaxValue ("101"), PUnit ("percent"), Units ("Percent")
The percentage of the job that has completed at the time that this value is requested. Note that this property is also present in the JobProcessingStatistics class. This class is necessary to capture the processing information for recurring Jobs, because only the \'last\' run data can be stored in this single-valued property.
Note that the value 101 is undefined and will be not be allowed in the next major revision of the specification.
PrimaryStatus
Data type: uint16
Access type: Read-only
Qualifiers: ModelCorrespondence ("CIM_ManagedSystemElement.DetailedStatus", "CIM_ManagedSystemElement.HealthState")
Indicates a high-level status value.
This property is inherited from CIM_ManagedSystemElement.
The possible values are.
Unknown (0)
OK (1)
Degraded (2)
Error (3)
DMTF Reserved (4 32767)
Vendor Reserved (32768 = value )
Priority
Data type: uint32
Access type: Read/write
Indicates the urgency or importance of execution of the Job. The lower the number, the higher the priority. Note that this property is also present in the JobProcessingStatistics class. This class is necessary to capture the setting information that would influence the results of a job.
RecoveryAction
Data type: uint16
Access type: Read-only
Qualifiers: ModelCorrespondence ("CIM_Job.OtherRecoveryAction")
Describes the recovery action to be taken for an unsuccessfully run Job.
| Value | Meaning |
|---|---|
| Unknown 0 | It is unknown as to what recovery action to take. |
| Other 1 | The recovery action will be specified in the OtherRecoveryAction property. |
| Do Not Continue 2 | Stop the execution of the job and appropriately update its status. |
| Continue With Next Job 3 | Continue with the next job in the queue. |
| Re-run Job 4 | The job should be re-run. |
| Run Recovery Job 5 | Run the Job associated using the RecoveryJob relationship. Note that the recovery Job must already be in the queue from which it will run. |
RunDay
Data type: sint8
Access type: Read/write
Qualifiers: MinValue ("-31"), MaxValue ("31"), ModelCorrespondence ("CIM_Job.RunMonth", "CIM_Job.RunDayOfWeek", "CIM_Job.RunStartInterval")
The day in the month on which the Job should be processed. There are two different interpretations for this property, depending on the value of DayOfWeek. In one case, RunDay defines the day-in-month on which the Job is processed. This interpretation is used when the DayOfWeek is 0. A positive or negative integer indicates whether the RunDay should be calculated from the beginning or end of the month. For example, 5 indicates the fifth day in the RunMonth and -1 indicates the last day in the RunMonth.
When RunDayOfWeek is not 0, RunDay is the day-in-month on which the Job is processed, defined in conjunction with RunDayOfWeek. For example, if RunDay is 15 and RunDayOfWeek is Saturday, then the Job is processed on the first Saturday on or after the 15th day in the RunMonth (for example, the third Saturday in the month). If RunDay is 20 and RunDayOfWeek is -Saturday, then this indicates the first Saturday on or before the 20th day in the RunMonth. If RunDay is -1 and RunDayOfWeek is -Sunday, then this indicates the last Sunday in the RunMonth.
RunDayOfWeek
Data type: sint8
Access type: Read/write
Qualifiers: ModelCorrespondence ("CIM_Job.RunMonth", "CIM_Job.RunDay", "CIM_Job.RunStartInterval")
A positive or negative integer used in conjunction with RunDay to indicate the day of the week on which the Job is processed. RunDayOfWeek is set to 0 to indicate an exact day of the month, such as March 1. A positive integer (representing Sunday, Monday, ..., Saturday) means that the day of week is found on or after the specified RunDay. A negative integer (representing -Sunday, -Monday, ..., -Saturday) means that the day of week is found on or BEFORE the RunDay.
-Saturday (-7)
-Friday (-6)
-Thursday (-5)
-Wednesday (-4)
-Tuesday (-3)
-Monday (-2)
-Sunday (-1)
ExactDayOfMonth (0)
Sunday (1)
Monday (2)
Tuesday (3)
Wednesday (4)
Thursday (5)
Friday (6)
Saturday (7)
RunMonth
Data type: uint8
Access type: Read/write
Qualifiers: ModelCorrespondence ("CIM_Job.RunDay", "CIM_Job.RunDayOfWeek", "CIM_Job.RunStartInterval")
The month during which the Job should be processed. Specify 0 for January, 1 for February, and so on.
January (0)
February (1)
March (2)
April (3)
May (4)
June (5)
July (6)
August (7)
September (8)
October (9)
November (10)
December (11)
RunStartInterval
Data type: datetime
Access type: Read/write
Qualifiers: ModelCorrespondence ("CIM_Job.RunMonth", "CIM_Job.RunDay", "CIM_Job.RunDayOfWeek", "CIM_Job.RunStartInterval")
The time interval after midnight when the Job should be processed. For example,
00000000020000.000000:000
indicates that the Job should be run on or after two o'clock, local time or UTC time (distinguished using the LocalOrUtcTime property.
ScheduledStartTime
Data type: datetime
Access type: Read/write
Qualifiers: Deprecated ("CIM_Job.RunMonth", "CIM_Job.RunDay", "CIM_Job.RunDayOfWeek", "CIM_Job.RunStartInterval")
The time that the current Job is scheduled to start. This time can be represented by the actual date and time, or an interval relative to the time that this property is requested. A value of all zeroes indicates that the Job is already executing. The property is deprecated in lieu of the more expressive scheduling properties, RunMonth, RunDay, RunDayOfWeek, and RunStartInterval.
StartTime
Data type: datetime
Access type: Read-only
The time that the Job was actually started. This time can be represented by an actual date and time, or by an interval relative to the time that this property is requested. Note that this property is also present in the JobProcessingStatistics class. This class is necessary to capture the processing information for recurring Jobs, because only the 'last' run time can be stored in this single-valued property.
Status
Data type: string
Access type: Read-only
Qualifiers: Deprecated ("CIM_ManagedSystemElement.OperationalStatus"), MaxLen (10)
Contains a string indicating the primary status of the object.
Note:
This property is deprecated and replaced by the OperationalStatus property. If you choose to use the Status property for backward compatibility it should be secondary to the OperationalStatus property.
This property is inherited from CIM_ManagedSystemElement.
The possible values are.
("OK")
("Error")
("Degraded")
("Unknown")
("Pred Fail")
("Starting")
("Stopping")
("Service")
("Stressed")
("NonRecover")
("No Contact")
("Lost Comm")
("Stopped")
StatusDescriptions
Data type: string array
Access type: Read-only
Qualifiers: ArrayType ("Indexed"), ModelCorrespondence ("CIM_ManagedSystemElement.OperationalStatus")
Indicates descriptions of the corresponding values in the OperationalStatus array. For example, if an element in the OperationalStatus property contains the value Stopping, then the element at the same array index in this property might contain an explanation as to why an object is being stopped.
This property is inherited from CIM_ManagedSystemElement.
TimeSubmitted
Data type: datetime
Access type: Read-only
The time that the Job was submitted to execute. A value of all zeroes indicates that the owning element is not capable of reporting a date and time. Therefore, the ScheduledStartTime and StartTime are reported as intervals relative to the time their values are requested.
UntilTime
Data type: datetime
Access type: Read/write
Qualifiers: ModelCorrespondence ("CIM_Job.LocalOrUtcTime")
The time after which the Job is invalid or should be stopped. This time can be represented by an actual date and time, or by an interval relative to the time that this property is requested. A value of all nines indicates that the Job can run indefinitely.
Requirements
| Requirement | Value |
|---|---|
| Minimum supported client | Windows 8 |
| Minimum supported server | Windows Server 2012 |
| Namespace | Root\standardcimv2 |
| MOF | NetTCPIP.mof |
| DLL | NetTCPIP.dll |
See also
Source: Microsoft Learn / Windows Win32 documentation by Microsoft and contributors (upstream author metadata: windowssdkdev). Documentation licensed CC BY 4.0. Code samples are covered by the MIT License. Converted from Markdown, with links normalized and embedded media omitted.
