Disable log truncation on all servers

PowerShell script exchange

Disable log truncation on all servers

Veeam Logoby dr_sybourg » Tue Mar 25, 2014 9:10 am

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
dr_sybourg
Lurker
 
Posts: 2
Liked: never
Joined: Tue Mar 25, 2014 8:41 am

Re: Disable log truncation on all servers

Veeam Logoby v.Eremin » Tue 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.
v.Eremin
Veeam Software
 
Posts: 13296
Liked: 974 times
Joined: Fri Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin

Re: Disable log truncation on all servers

Veeam Logoby dr_sybourg » Tue Mar 25, 2014 10:29 am

Thanks that worked a treat!
dr_sybourg
Lurker
 
Posts: 2
Liked: never
Joined: Tue Mar 25, 2014 8:41 am

Re: Disable log truncation on all servers

Veeam Logoby v.Eremin » Tue Mar 25, 2014 10:43 am

You're welcome. Should any other help be needed, don't hesitate to let me know. Thanks.
v.Eremin
Veeam Software
 
Posts: 13296
Liked: 974 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 6 guests