PowerShell script exchange
Post Reply
drew.taylor
Lurker
Posts: 1
Liked: never
Joined: Feb 23, 2023 10:01 pm
Full Name: Drew Taylor
Contact:

SQL Transaction Logs for Agent Jobs

Post by drew.taylor »

I have hit a bit of a wall and my searches haven't found anything helpful yet. I am trying to query VBR using powershell to get the results of transaction log backups. While I have been able to do this successfully for non-agent jobs, I am coming up empty with being able to identify which sessions are specifically for transaction log backups. Has someone else solved this? Or have any pointers? Thanks.
david.domask
Veeam Software
Posts: 1226
Liked: 323 times
Joined: Jun 28, 2016 12:12 pm
Contact:

Re: SQL Transaction Logs for Agent Jobs

Post by david.domask »

Hi @drew.taylor,

Right now I'm not sure there's a supported method for this; on v12 you can fetch this with some unsupported internal methods:

$job = Get-VBRJob -Name 'name of the agent job' -WarningAction SilentlyContinue #Note: Fetching agent jobs with this cmdlet is deprecated, but should work for awhile until we get full support on the cmdlets for getting the child jobs.
$AgentChild = $job.FindChildJobs()
$Tlog = $AgentChild.FindChildSqlLogBackupJob()

This will get you the Transaction Log backup; you can get the most recent session with $Tlog.FindLastSession().
David Domask | Product Management: Principal Analyst
Post Reply

Who is online

Users browsing this forum: No registered users and 10 guests