PowerShell script exchange
Post Reply
maanlicht
Enthusiast
Posts: 26
Liked: 5 times
Joined: Apr 05, 2023 1:06 pm
Full Name: maanlicht
Contact:

Get-VBRCopyBackupSession usage examples

Post by maanlicht »

Dear Veeam community,

There seems to be some unclarity on how to use the ‘Get-VBRCopyBackupSession’ command.
To monitor backup-copy jobs I am looking to get the date of the last successful backup-copy run.

In V11 I was used to do that using the ‘Get-VBRBackupSession’ command. With V12 we got the fancy new command ‘Get-VBRCopyBackupSession’.

The documentation however doesn’t provide an example on how to use it.
Source: https://helpcenter.veeam.com/docs/backu ... ml?ver=120

I would expect it to return all sessions if I just ran the ‘Get-VBRCopyBackupSession’ command without any properties. But it doesn’t return anything although I have copy jobs running for some time. (Yes I converted the legacy jobs to the modern v12 backup-copy jobs)
The documentation suggests to use the ‘get-vbrbackup’ command so we can use the ‘-backup’ property. However whenever I run the following code snippit it returns an error complaining about the datatype used.

Code: Select all

$VBRBackup = Get-VBRBackup -name '<Jobname>'
Get-VBRCopyBackupSession -Backup $VBRBackup
Returned Error:
Get-VBRCopyBackupSession : Cannot bind parameter 'Backup'. Cannot convert the "Veeam.Backup.Core.CBackup" value of type "Veeam.Backup.Core.CBackup" to type "Veeam.Backup.PowerShell.Infos.VBRBackup".
My question to the community is if someone could provide an example snippit on how to use this command.

Thanks in advance for any advice!
david.domask
Veeam Software
Posts: 1226
Liked: 322 times
Joined: Jun 28, 2016 12:12 pm
Contact:

Re: Get-VBRCopyBackupSession usage examples

Post by david.domask »

Hi @maanlicht, I believe this cmdlet is meant for tracking Copying Backup operation sessions: https://helpcenter.veeam.com/docs/backu ... ml?ver=120

It's not for Backup Copies. You should pass those to Get-VBRBackupSession still:

https://helpcenter.veeam.com/docs/backu ... ml?ver=120

(Note the Detailed Description Section)
David Domask | Product Management: Principal Analyst
Post Reply

Who is online

Users browsing this forum: No registered users and 14 guests