Hello, I was able to create a script (below) to get the information I want from Veeam backup server.
One very cool feature I want to work with is Veeam's ability to retrieve Guest OS name. I am able to get that information when querying a job's object and if the vm has gone through one run of its job, but not in any other case.
How can I get the Guest Os Name for any VM?
Like what can be seen from: Inventory > Virtual Infrastructure > Microsoft Hyper-V > Standalone Hosts (click on a host, wait for info: Guest OS column populated)
Using VBR 11 on Standalone Hyper-V Hosts exclusively. VBR v12 soon to be installed.
# Get all Jobs from my Veeam backup server
$jobs = Get-VBRJob
# For each job gather information to report
$report = foreach ($job in $jobs) {
# For each vm in each backup job
$allMyBackedUpVms = Get-VBRJobObject -Job $job
# For each vm in each backup job get some info
foreach ($backedUpVm in $allMyBackedUpVms) {
$gatherInfo = [PSCustomObject]@{
BackedUpName = $backedUpVm.Name
BackedUpOsName = $backedUpVm.GetObject().GuestInfo.GetGuestOsName()
BackedUpFrom = $backedUpVm.Location
BackUpEstimSize = $backedUpVm.ApproxSizeString
}
# Which job this vm is member of
$gatherInfo | Add-Member -MemberType NoteProperty -Name 'VeeamJobName' -Value $job.Name
$gatherInfo
}
}
# PowerShell view
$report |Out-GridView
Thank you for providing clarification, ronnmartin61.
However, I am a bit disappointed as I can still see some virtual machines' operating system names from Standalone Hosts in Inventory, even though they haven't gone through one cycle. Do you know of a good place to propose a feature request for the Veeam PowerShell snap-in?
It's unfortunate that the Hyper-V PowerShell module isn't helpful in this regard. Perhaps I'm not looking in the right place.
Honestly I'm not sure what SDK we are using to pull the Hyper-V guest OS name in the VBR inventory view perhaps someone from engineering will comment. This is the proper venue to submit feature requests as these discussion boards are closely monitored by our product management staff...
I think inventory view does a live look-up of the items from the Infrastructure. Try Find-VBRHvEntity and search for VMs and see if that works for your purposes. You can match the UUID property from that cmdlet to the same UUID value on VMs in jobs with:
$job = Get-VBRJob -name 'name of your job'
$Objects = Get-VBRJobObject -Job $job
$Objects.GetObject().Uuid
It's a little tricky, but should work.
The Find-VBR*Entity cmdlets can be a bit slow sometimes to fetch from the production environment, so I advise get all the VMs into an array first and check against that array.
David Domask | Product Management: Principal Analyst