PowerShell script exchange
mdiver
Veeam Legend
Posts: 201
Liked: 33 times
Joined: Nov 04, 2009 2:08 pm
Location: Heidelberg, Germany
Contact:

Re: Get all used backup repositories of a backup job

Post by mdiver »

oleg.feoktistov wrote: Jul 03, 2020 2:17 pm Hi Mike,

First, CStorageToExtentAssociationService class is deprecated. So, remove the line below:

Code: Select all

$svc = [Veeam.Backup.Core.CStorageToExtentAssociationService]::new()
Then, pass storage id as the only argument to FindExtentRepo() method accordingly:

Code: Select all

$ext = $realsobr.FindExtentRepo($st.Id)
And you are good to go.

Cheers!
Oleg
Hi Oleg.

I fear with V11 we're once again out with the code. Could I ask you for an update?

Thanks and regards
Michael
oleg.feoktistov
Veeam Software
Posts: 1918
Liked: 636 times
Joined: Sep 25, 2019 10:32 am
Full Name: Oleg Feoktistov
Contact:

Re: Get all used backup repositories of a backup job

Post by oleg.feoktistov » 1 person likes this post

Hi Michael,

Looks like FindExtentRepo() method became static. So, you need to expand CExtendableRepository class directly to invoke it. For example:

Code: Select all

$backup = Get-VBRBackup
$storages = $backup.GetAllStorages()
foreach ($storage in $storages) {
  $extent = [Veeam.Backup.Core.CExtendableRepository]::FindExtentRepo($storage.Id)
}
Best regards,
Oleg
mdiver
Veeam Legend
Posts: 201
Liked: 33 times
Joined: Nov 04, 2009 2:08 pm
Location: Heidelberg, Germany
Contact:

Re: Get all used backup repositories of a backup job

Post by mdiver » 1 person likes this post

Thanks a lot, Oleg, for - once again - an ultra fast answer. The API seems to be in constant flow... ;)
I just have to say this forum is outstanding, as it is maintained perfectly even in these undocumented areas.
oleg.feoktistov
Veeam Software
Posts: 1918
Liked: 636 times
Joined: Sep 25, 2019 10:32 am
Full Name: Oleg Feoktistov
Contact:

Re: Get all used backup repositories of a backup job

Post by oleg.feoktistov »

Well, those are undocumented methods, but I'm trying to keep track on them anyway :wink:
Glad to know it helps.
Post Reply

Who is online

Users browsing this forum: No registered users and 16 guests