Hi
@wgoodall,
So just to make sure I get it right, the goal is to check for any non-Windows and non-Linux VMs being backed up? Is that correct?
I think you might want to go with the following:
1. Get all Jobs and save to some variable $jobs ( $jobs = Get-VBRJob )
2. Foreach Job, loop over it and
2a. Save the job objects to $JobObjects = Get-VBRJobObject -Job $job
2b. Each CJobObject has a GetObject() method, and we can use the GuestInfo property to get GuestInfo.
So something like:
Code: Select all
$jobs = Get-VBRJob
$jobObjects = @()
Foreach($j in $jobs){
$loopObjects = $j.GetObjectsinJob()
Foreach($lo in $loopObjects){
$ObjectJobData = [PSCUstomObject]@{
JobName = $j.Name
JobObject = $lo.name
ObjectGuestOSType = $lo.GetObject().GuestInfo.GetOsType()
}
$jobObjects += $ObjectJobData
}
}
PS C:\Users\Administrator> $jobObjects
JobName JobObject ObjectGuestOSType
------- --------- -----------------
old-vbr ddom-veeam-rb3-buch windows2019srv_64Guest
restore-test C:\ProgramData\Veeam\Backup otherGuest
vmware-ffi-cap-bb ddom-tinyvm windows2019srv_64Guest
vmware-per-job ddom-tinyvm windows2019srv_64Guest
vmware-per-job DDom-TinyVM_replica windows8Server64Guest
vmware-direct-objstg ddom-tinyvm windows2019srv_64Guest
vmware-direct-objstg ddom-tinyvm_replica windows2019srv_64Guest
vmware-direct-objstg DDom-TinyVM_replica windows8Server64Guest
quick-rep ddom-tinyvm windows2019srv_64Guest
quick-rep ddom-tinyvm_replica windows2019srv_64Guest
convert-test ddom-tinyvm windows2019srv_64Guest
convert-test ddom-tinyvm_replica windows2019srv_64Guest
simple-replica ddom-tinyvm windows2019srv_64Guest
simple-replica ddom-debian-backmeup debian10_64Guest
And then I would just filter on anything that returns otherGuest and look for any "unique" backups in your environment. (if it were me and I had a standard linux distribution, I would check where the ObjectGuestOSType is not like windows* or the various linux flavors that I know are in my environment).
Does this help?
Edit: Also, if you want those names to be "friendlier", you can just write a function that converts the expected output and checks for windows* or your various linux flavors you use and just change that property on the PSCustomObject to Windows or Linux respectively.
This might make your checking easier and will also show you when someone deploys an unexpected distro
Perfect for wrist slapping if you have regulations on what to be deployed
.