Lists jobs running on each node.

Visual Basic
Edit|Remove
strClusterName = "localhost" 'Change to name of cluster if not run locally.
Set objComputeCluster = CreateObject("Microsoft.ComputeCluster.Cluster")
objComputeCluster.Connect(strClusterName)
WScript.Echo "Compute Cluster Name: " & objComputeCluster.Name
WScript.Echo "Compute Cluster Nodes"
Set colNodes = objComputeCluster.ComputeNodes
For Each objNode In colNodes
  WScript.Echo "  Name: " & objNode.Name
  WScript.Echo "    Number of Processors: " & objNode.NumberOfProcessors
  WScript.Echo "    Number of Idle Processors: " & _
   objNode.NumberOfIdleProcessors
  WScript.Echo "    Processor Architecture: " & objNode.ProcessorArchitecture
  WScript.Echo "    Processor Speed: " & objNode.ProcessorSpeed & " MHz"
  WScript.Echo "    Memory: " & objNode.Memory & " MB"
  strStatus = ""
  Select Case objNode.Status
    Case 0 strStatus = "Ready"
    Case 1 strStatus = "Paused"
    Case 2 strStatus = "Unreachable"
    Case 3 strStatus = "Pending Approval"
    Case Else strStatus = "Status unobtainable"
  End Select
  WScript.Echo "    Status: " & strStatus
  Set colRunningJobs = objComputeCluster.ListJobsOnNode(objNode.Name)
  WScript.Echo "    Running Jobs:"
  intCount = 0
  For Each objJob In colRunningJobs
    WScript.Echo "      " & objJob.Name
    intCount = intCount + 1
  Next
  WScript.Echo "      Number of jobs running on this node: " & intCount
Next