cancel
Showing results for 
Search instead for 
Did you mean: 

Where do I find JobID?

Guy_Scharf
Level 4

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!

1 ACCEPTED SOLUTION

Accepted Solutions

Markus_Koestler
Moderator
Moderator
   VIP   

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."

View solution in original post

2 REPLIES 2

Markus_Koestler
Moderator
Moderator
   VIP   

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."

Guy_Scharf
Level 4

Thank you.  I had just found the example RemoveJobs script and saw that was a way to get the ID.  I'll go looking for the *.pqj file and see what it looks like.