PowerShell script exchange
Post Reply
randombdk
Novice
Posts: 3
Liked: never
Joined: Oct 15, 2018 6:32 am
Full Name: Lars Knakkergaard
Contact:

Exporting list of vms in repositiory

Post by randombdk »

hi,

Im trying to export a list of vms in a repository - i dont have the liberty to track it based on a backup job

I cant seem to find any cmdlet to be able to tell me vms and restore point inside a repo.

My wish is

Name xx RestorePoints xx Creation Date

This is due to rather big cleanup - this repo specific is 340 vms so i dont wanna go all in on copy paste them all.
Vek17
Service Provider
Posts: 49
Liked: 15 times
Joined: May 29, 2018 8:42 pm
Contact:

Re: Exporting list of vms in repositiory

Post by Vek17 »

Assuming this is a simple repo and not an SoBR then something like this will work:

Code: Select all

(Get-VBRBackupRepository -Name "Repository Name").GetBackups().GetOibs() | Select VmName, CreationTime
If you are using an SoBR it is a bit more complicated to separate extents, but still very doable.
randombdk
Novice
Posts: 3
Liked: never
Joined: Oct 15, 2018 6:32 am
Full Name: Lars Knakkergaard
Contact:

Re: Exporting list of vms in repositiory

Post by randombdk »

Hi,

It gives me an error :

(I have connected to the vbr server with Connect-VBRServer

PS C:\Users\lkn.PROD> (Get-VBRBackupRepository -Name "backup").GetBackups().GetOibs() | Select VmName, CreationTime
You cannot call a method on a null-valued expression.
At line:1 char:1
+ (Get-VBRBackupRepository -Name "backup").GetBackups().GetOibs() | Sel ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation: (:) [], RuntimeException
+ FullyQualifiedErrorId : InvokeMethodOnNull

any where to get more documentation on this?
jhoughes
Veeam Vanguard
Posts: 279
Liked: 112 times
Joined: Apr 20, 2017 4:19 pm
Full Name: Joe Houghes
Location: Castle Rock, CO
Contact:

Re: Exporting list of vms in repositiory

Post by jhoughes »

Try running it one piece at a time, and you'll find where the issue lies:

Code: Select all

(Get-VBRBackupRepository -Name "backup")

(Get-VBRBackupRepository -Name "backup").GetBackups()

(Get-VBRBackupRepository -Name "backup").GetBackups().GetOibs()

(Get-VBRBackupRepository -Name "backup").GetBackups().GetOibs() | Select VmName, CreationTime
At which point does it not work starting from the top?
Husband, Father, Solutions Architect, Geek Extraordinaire | @DenverVMUG, @AustinVMUG & @ATXPowerShell leader | VMware vExpert | Cisco Champion
Post Reply

Who is online

Users browsing this forum: No registered users and 11 guests