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!
-
- Influencer
- Posts: 24
- Liked: never
- Joined: Jul 06, 2017 6:07 am
- Contact:
-
- Product Manager
- Posts: 20414
- Liked: 2302 times
- Joined: Oct 26, 2012 3:28 pm
- Full Name: Vladimir Eremin
- Contact:
Re: Get all jobs with pre- and post-freeze scripts
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
-
- Influencer
- Posts: 24
- Liked: never
- Joined: Jul 06, 2017 6:07 am
- Contact:
Re: Get all jobs with pre- and post-freeze scripts
This does exactly what I need, thanks a lot!
-
- Product Manager
- Posts: 20414
- Liked: 2302 times
- Joined: Oct 26, 2012 3:28 pm
- Full Name: Vladimir Eremin
- Contact:
Re: Get all jobs with pre- and post-freeze scripts
You're welcome. You can get job object VSS settings, using the following approach:
So, whenever you're in need to find some job object VSS settings, check the VSSOptions first.
Thanks.
Code: Select all
$Job = Get-VBRJob -name "Name of your Job"
$JobObject = Get-VBRJobObject -Job $Job -name "Name of job object"
$JobObject.VSSOptions
Thanks.
Who is online
Users browsing this forum: No registered users and 8 guests