Lists counts of tasks by status of a specific job.

Visual Basic
Edit|Remove
intJobID = 4 'Must be an existing job.

Set objComputeCluster = CreateObject("Microsoft.ComputeCluster.Cluster")
objComputeCluster.Connect("localhost")

WScript.Echo "Compute Cluster Name: " & objComputeCluster.Name
WScript.Echo "Job " & intJobID

Set objJobCounter = objComputeCluster.GetJobCounter(intJobID)

WScript.Echo "  Not Submitted Tasks: " & objJobCounter.NumberOfNotSubmittedTasks
WScript.Echo "  Queued Tasks       : " & objJobCounter.NumberOfQueuedTasks
WScript.Echo "  Running Tasks      : " & objJobCounter.NumberOfRunningTasks
WScript.Echo "  Finished Tasks     : " & objJobCounter.NumberOfFinishedTasks
WScript.Echo "  Failed Tasks       : " & objJobCounter.NumberOfFailedTasks
WScript.Echo "  Cancelled Tasks    : " & objJobCounter.NumberOfCancelledTasks