PowerShell script exchange
Post Reply
lhas
Novice
Posts: 3
Liked: never
Joined: Sep 09, 2020 7:34 am
Full Name: Lasse Hastrup
Contact:

Get report on a single VM

Post by lhas »

Hi guys,

I would like to get the following "attributes/values" for a specific Virtual Machine using PowerShell.

$vmName = 'xx'

Attributes to output:

MachineName
JobName(s)
RestorePoints
LastSuccess

Is this possible to achive using PowerShell?
To be honest i tried myself, but i wasnt able to figure it out.

Thanks in advance!

Andreas Neufert
VP, Product Management
Posts: 4521
Liked: 857 times
Joined: May 04, 2011 8:36 am
Full Name: Andreas Neufert
Location: Germany
Contact:

Re: Get report on a single VM

Post by Andreas Neufert »


lhas
Novice
Posts: 3
Liked: never
Joined: Sep 09, 2020 7:34 am
Full Name: Lasse Hastrup
Contact:

Re: Get report on a single VM

Post by lhas »

Hi Andreas,
Yea, i found that article aswell, however it doesn't give me what i desire the outcome to be.
It seems I need to use 10 different functions to get the output i desire, because for some reason using PowerShell with Veeam should be complicated :)

jhoughes
Veeam Software
Posts: 209
Liked: 71 times
Joined: Apr 20, 2017 4:19 pm
Full Name: Joe Houghes
Location: Austin, TX
Contact:

Re: Get report on a single VM

Post by jhoughes »

Well, part of it is because of the detail that you are asking to find and your source information.

With a single VM, you are asking about a job object. However, even your VM jobs may not include VMs directly, but they may target folders, clusters, datastores, or tags.

To accurately get the list of restore points for a single VM and that detail, it is best to start with your backups.

You would gather the detail of which VMs are within the backups (plus job name and last success), and then get the associated restore points for the particular VM in that backup.

It's just that you are looking for a single VM to be the basis of your query, which either requires investigating every vSphere job object that isn't a VM directly, or starting with the backup data to determine the objects contained within a backup.

This is all easy, but there is no simple cmdlet to investigate from a single VM perspective.
Husband, Father, Solutions Architect, Geek Extraordinaire | @AustinVMUG & @ATXPowerShell leader | VMUG US South Regional Champion | VMware vExpert | Cisco Champion

lhas
Novice
Posts: 3
Liked: never
Joined: Sep 09, 2020 7:34 am
Full Name: Lasse Hastrup
Contact:

Re: Get report on a single VM

Post by lhas »

Thanks for responding.

Yea, i guess you're right. It's different functions for diffrent purposes. I had hoped that something like Find-VBRViEntity would do the trick.
Do you have any sample code that give me the desired output?

Post Reply

Who is online

Users browsing this forum: Baidu [Spider] and 5 guests