Get all jobs with pre- and post-freeze scripts

PowerShell script exchange

Get all jobs with pre- and post-freeze scripts

Veeam Logoby Sand » Thu Jul 06, 2017 6:18 am

I try to get all jobs that use guest processing pre- and post scripts. I've bin digging the powershell documentation and examples but was only able to get all VSS Enabled jobs so far.

Is it possible to get this information via powershell? I've tried Get-VBRJobObject and get-VBRJobVSSOptions but couldn't find this info in there.

Thanks in advance!
Sand
Novice
 
Posts: 5
Liked: never
Joined: Thu Jul 06, 2017 6:07 am

Re: Get all jobs with pre- and post-freeze scripts

Veeam Logoby v.Eremin » Thu Jul 06, 2017 12:40 pm 1 person likes this post

I believe this one-liner is something you're after:

Code: Select all
Get-VBRJob | Where {$_.GetObjectsInJob().VssOptions.GuestScriptsOptions.IsAtLeastOneScriptSet -eq $True -and $_.GetObjectsInJob().VssOptions.GuestScriptsOptions.ScriptingMode -ne "Disabled"} | select name
v.Eremin
Veeam Software
 
Posts: 13558
Liked: 1006 times
Joined: Fri Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin

Re: Get all jobs with pre- and post-freeze scripts

Veeam Logoby Sand » Thu Jul 06, 2017 12:51 pm

This does exactly what I need, thanks a lot!
Sand
Novice
 
Posts: 5
Liked: never
Joined: Thu Jul 06, 2017 6:07 am

Re: Get all jobs with pre- and post-freeze scripts

Veeam Logoby v.Eremin » Thu Jul 06, 2017 2:21 pm

You're welcome. You can get job object VSS settings, using the following approach:

Code: Select all
$Job = Get-VBRJob -name "Name of your Job"
$JobObject = Get-VBRJobObject -Job $Job -name "Name of job object"
$JobObject.VSSOptions

So, whenever you're in need to find some job object VSS settings, check the VSSOptions first.

Thanks.
v.Eremin
Veeam Software
 
Posts: 13558
Liked: 1006 times
Joined: Fri Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin


Return to PowerShell



Who is online

Users browsing this forum: No registered users and 4 guests