-
- Lurker
- Posts: 1
- Liked: never
- Joined: Feb 23, 2023 10:01 pm
- Full Name: Drew Taylor
- Contact:
SQL Transaction Logs for Agent Jobs
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.
-
- Veeam Software
- Posts: 2120
- Liked: 513 times
- Joined: Jun 28, 2016 12:12 pm
- Contact:
Re: SQL Transaction Logs for Agent Jobs
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().
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
Who is online
Users browsing this forum: Semrush [Bot] and 12 guests