Where do I find JobID?
I'm looking at the SSR 2011 sample script CreateIncrementalImage.vbs as a possible model to help manage laptop backups. The script identifies the job to be run by using a job id.
Where do I find the job id for a backup job that I have created? Is there any script function to look up the job id given the job name that I have created?
Thanks!
One place is the *.pqj file, afaik the name of this file is the job id. Another would be to iterate over all jobs on a client. I've used the following script to remove every job on the clients. I'm sure you an rework this to meet your requirements.
Option Explicit
Dim v2iAuto
Dim Computer
Dim oCurrentJob
Computer = WScript.Arguments(0)
'
' Step 1: Create a LiveState Recovery automation object
'
Set v2iAuto = CreateObject("Symantec.ProtectorAuto")
'
' Step 2: Connect to the local agent
'
WScript.Echo "Connecting to " & Computer &" ..."
Call v2iAuto.Connect(Computer)
'
' Step 3: Iterate over all image jobs and remove each one
'
For Each oCurrentJob in v2iAuto.ImageJobs
v2iAuto.RemoveImageJob(oCurrentJob.ID)
WScript.Sleep 500 ' allow console time to refresh if it's
running
Next
WScript.Echo "Jobs removed successfully."