PowerShell script exchange
Post Reply
mcclans
Influencer
Posts: 16
Liked: 2 times
Joined: Feb 17, 2015 2:05 pm
Full Name: Shawn McClanahan
Contact:

Listing all Job Options via powershell

Post by mcclans »

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 :)
veremin
Product Manager
Posts: 20270
Liked: 2252 times
Joined: Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin
Contact:

Re: Listing all Job Options via powershell

Post by veremin »

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.
Post Reply

Who is online

Users browsing this forum: No registered users and 18 guests