PowerShell script exchange
Post Reply
dr_sybourg
Lurker
Posts: 2
Liked: never
Joined: Mar 25, 2014 8:41 am
Contact:

Disable log truncation on all servers

Post by dr_sybourg »

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:

Re: Disable log truncation on all servers

Post by veremin » 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:

Re: Disable log truncation on all servers

Post by dr_sybourg »

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:

Re: Disable log truncation on all servers

Post by veremin »

You're welcome. Should any other help be needed, don't hesitate to let me know. Thanks.
Post Reply

Who is online

Users browsing this forum: No registered users and 11 guests