Listing all Job Options via powershell

PowerShell script exchange

Listing all Job Options via powershell

Veeam Logoby mcclans » Mon Apr 04, 2016 3:47 pm

So I used v.Eremin's info to change all the backup / repl jobs to enable bit looker which worked great.

Code: Select all
asnp VeeamPSSNapin
foreach ($Job in Get-VBRJob | where {$_.JobType -eq "Backup" -or $_.JobType -eq "Replica"})
{
$Options = $Job.GetOptions()
$Options.ViSourceOptions.DirtyBlocksNullingEnabled = $True
$Job.SetOptions($Options)
}


This got me thinking it would be nice to set other jobs options via the same method but I'm failing to see where to list all available job options to ensure uniformity across all jobs. I'm sure that I'm overlooking something simple. I was reading Luca's post on something similar but still failing to see how to list all job options.

http://www.virtualtothecore.com/en/chec ... owershell/

Any pointers appreciated :)
mcclans
Influencer
 
Posts: 15
Liked: 2 times
Joined: Tue Feb 17, 2015 2:05 pm
Full Name: Shawn McClanahan

Re: Listing all Job Options via powershell

Veeam Logoby v.Eremin » Tue Apr 05, 2016 10:03 am

Most of the jobs options can be found under $Job.GetOptions(). Typical solution looks like the following:

1) Assign GetOptions() to a variable
2) Tweak the variable however you like
3) Pass the changed variable to a job using .SetOptions() method

Thanks.
v.Eremin
Veeam Software
 
Posts: 13255
Liked: 968 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 5 guests