CIM_Job class (Hyper-V management)
A logical element that represents a unit of work to execute, such as a script or a print job. A job is distinct from a process because a job can be scheduled or queued, and its execution is not limited to a single system.
Syntax
[Abstract, Version("2.10.0"), UMLPackagePath("CIM::Core::CoreElements"), AMENDMENT]
class CIM_Job : CIM_LogicalElement
{
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 | This method is deprecated. Instead, use the RequestStateChange method. Note: Deprecated description: Shuts down a job. |
Properties
The CIM_Job class has these properties.
-
DeleteOnCompletion
-
-
Data type: boolean
-
Access type: Read/write
True to delete the job upon completion; otherwise, false.
Note
This property will not delete jobs that complete before this property is set to True.
-
-
ElapsedTime
-
-
Data type: datetime
-
Access type: Read-only
The duration for which the job has run.
-
-
ErrorCode
-
-
Data type: uint16
-
Access type: Read-only
-
Qualifiers: ModelCorrespondence ("CIM_Job.ErrorDescription")
A vendor-specific error code that captures processing information for recurring jobs. The value must be set to zero if the job completed without error.
-
-
ErrorDescription
-
-
Data type: string
-
Access type: Read-only
-
Qualifiers: ModelCorrespondence ("CIM_Job.ErrorCode")
A free-form string that contains a description of the corresponding error code in the ErrorCode property.
-
-
JobRunTimes
-
-
Data type: uint32
-
Access type: Read/write
The number of times to run the job.
-
-
JobStatus
-
-
Data type: string
-
Access type: Read-only
-
Qualifiers: ModelCorrespondence ("CIM_ManagedSystemElement.OperationalStatus")
A free-form string that represents the status of the job.
-
-
LocalOrUtcTime
-
-
Data type: uint16
-
Access type: Read/write
Indicates whether the times in the RunStartInterval and UntilTime properties represent local times or UTC times.
-
-
Local Time (1)
-
UTC Time (2)
Notify
-
Data type: string
-
Access type: Read/write
The user to notify when a job completes or fails.
OtherRecoveryAction
-
Data type: string
-
Access type: Read-only
-
Qualifiers: ModelCorrespondence ("CIM_Job.RecoveryAction")
A string that describes the recovery action when the RecoveryAction property is Other ("1").
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 requested the job.
PercentComplete
-
Data type: uint16
-
Access type: Read-only
-
Qualifiers: Units ("Percent"), MinValue (0), MaxValue (101), PUnit ("percent")
The percentage of the job that is complete.
Note
The value "101" is undefined and will be not be allowed in the next major revision of the specification.
Priority
-
Data type: uint32
-
Access type: Read/write
The importance of the job. The lower the number, the higher the priority.
RecoveryAction
-
Data type: uint16
-
Access type: Read-only
-
Qualifiers: ModelCorrespondence ("CIM_Job.OtherRecoveryAction")
Describes the recovery action to take when a run job fails.
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")
An integer that is used on conjunction with the RunDayOfWeek property to indicate the day when the job is processed; or, if RunDayOfWeek is set to zero, RunDay indicates the day of the month when the job is processed. If RunDay is a negative integer, it specifies a day relative to the end of the month, or if RunDay is a positive integer, it specifies a day relative to the beginning of the month.
RunDayOfWeek
-
Data type: sint8
-
Access type: Read/write
-
Qualifiers: ModelCorrespondence ("CIM_Job.RunMonth", "CIM_Job.RunDay", "CIM_Job.RunStartInterval")
An integer that is used on conjunction with the RunDay property to indicate the day when the job is processed; or, if RunDayOfWeek is set to zero, RunDay indicates the day of the month when the job is processed.
-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 when the job is processed.
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 is be processed. For example, "00000000020000.000000:000" indicates that the job is be run on or after two o'clock local time, or UTC time (UTC is specified with 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")
Note
This property is deprecated. Instead we recommend that you use the RunMonth, RunDay, RunDayOfWeek, and RunStartInterval properties.
The time when the current job is scheduled to start. This time can be represented by a date and time, or an interval relative to the time when the property is requested. A value of all zeroes indicates that the job is already executing.
StartTime
-
Data type: datetime
-
Access type: Read-only
The time when the job started. This time can be represented by a date and time, or by an interval relative to the time when the property is requested.
TimeSubmitted
-
Data type: datetime
-
Access type: Read-only
The time when the job was submitted. A value of all zeroes indicates that the parent element is not capable of reporting a date and time.
UntilTime
-
Data type: datetime
-
Access type: Read/write
-
Qualifiers: ModelCorrespondence ("CIM_Job.LocalOrUtcTime")
The time after which the job becomes invalid or should be stopped. The time can be represented by a date and time, or by an interval relative to the time when 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\virtualization\v2 |
MOF |
|
DLL |
|