PowerShell script exchange
dr_sybourg
Lurker
Posts: 2 Liked: never
Joined: Mar 25, 2014 8:41 am
Contact:
Post
by dr_sybourg » Mar 25, 2014 9:10 am
this post
Hi There,
I am using Veeam 7.0.0.833 and was looking for some help in disabling log truncation on all jobs using a powershell script. I did find an example from a Veeam rep on this forum but it did not work, I think maybe its from an older version?
Code: Select all
Asnp VeeamPSSnapin
foreach ($job in Get-VBRJob )
{
$Objects = Get-VBRJobObject -job $Job
foreach ($object in $Objects){
$VSSOptions = $object.GetVssOptions()
$VSSOptions.TransactionLogsTruncation = "Never"
$object.SetVssOptions($VSSOptions)
}
}
Thanks
veremin
Product Manager
Posts: 20406 Liked: 2298 times
Joined: Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin
Contact:
Post
by veremin » Mar 25, 2014 10:14 am
1 person likes this post
There must be a typo in the script provided, because JobObject doesn't contain GetVSSOptions() methods, instead, it contains VSSOptions property. Thus, the script should be modified slightly:
Code: Select all
Asnp VeeamPSSnapin
foreach ($job in Get-VBRJob )
{
$Objects = Get-VBRJobObject -job $Job
foreach ($object in $Objects){
$VSSOptions = $object.VssOptions
$VSSOptions.TransactionLogsTruncation = "Never"
$object.SetVssOptions($VSSOptions)
}
}
Thanks.
dr_sybourg
Lurker
Posts: 2 Liked: never
Joined: Mar 25, 2014 8:41 am
Contact:
Post
by dr_sybourg » Mar 25, 2014 10:29 am
this post
Thanks that worked a treat!
veremin
Product Manager
Posts: 20406 Liked: 2298 times
Joined: Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin
Contact:
Post
by veremin » Mar 25, 2014 10:43 am
this post
You're welcome. Should any other help be needed, don't hesitate to let me know. Thanks.
Users browsing this forum: No registered users and 11 guests