[PowerShell, PowerCLI] Check for VMs that are not being backuped



Show first post

38 comments

Userlevel 1

good point

That shows restore points from the query. 

Those backups are too old for us to be used anyway, I think what I will do is to purge them and set up new one for that box. I don’t see any other servers with this problem. 

 

I realize this might be off topic but is there a script that would get us output of restore points older than x years and purge ones older than specified date or is it all based on configured retention only? 

Userlevel 1

I was hoping that Veeam Legend would be kind enough to help us out with that :) 

Userlevel 2
# Read Credential-File
$WorkingDir = "C:\_install\script\"
$CredObject = Import-Clixml -Path ($WorkingDir + "CredObject.xml")

Hello! 

Could you help me, what Credential-File should I provide? 

 

Userlevel 7
Badge +13

Very usable! Thank you for this share.

You are welcome!

Been a while but does anyone know how to pick up only VM’s that’s not backed up past day??

The script works great and I have added the email portion to it so we get a nice HTML bodied email with all the VM’s not backing up.

I need this to work on VM’s not backed up past day, any ideas??

 

Thanks in advanced.

Userlevel 7
Badge +20

Another great script to add to my repo of scripts.  Thanks for the contribution. :smiley:

Userlevel 7
Badge +14

@JMeixner Well the backup user could have only limited permissions on a certain container/folder, because of security reasons. On the other hand I think it's a very unlikely scenario that you're missing VMs in the backup on which you don't have access...😅

Userlevel 7
Badge +17

@JMeixnerWell the backup user could have only limited permissions on a certain container/folder, because of security reasons. On the other hand I think it's a very unlikely scenario that you're missing VMs in the backup on which you don't have access...😅


This is what I thought 😎

But it is possible… on the other hand, this can happen with PowerCLI, too.

Userlevel 7
Badge +13

@vNote42I thought about your script (which is very useful by the way) and wondered if we could remove the PowerCLI as a dependency. We could query all VMs with the Veeam cmdlet “Find-VBRViEntity”; given that the Veeam account can see all VMs.

$VMs = Find-VBRViEntity -VMsAndTemplates | where id -like "*VM*"

Any thoughts on this? Do I forget something here, which could result in wrong or missing results?

 

Also is there a way via to get the VMware MoRef ID with the Veeam Powershell? I know this value is in the database, but I couldn’t find it in the Powershell. This way we could create a 100% match for VM/restorepoint.

Good idea @regnor ! I resinized find-vbrvientity some time ago. But I did not test any further. Would be a nice feature not to need PowerCLI any more. But you are probably right, you will just get VMs the user has permissions for.

I will try it, when I next need the script :slight_smile:


The Veeam user should have permission to access all VMs, shouldn't it? Otherwise you are not able to backup all of your VMs….

Is not a must. I have a customer, backing up about half VMs with Veeam, other half of VMs with another vendors product. Currently Veeam-Users sees all VMs (we migrate all VMs backup to Veeam :sunglasses: ). With PowerCLI it is much easier to select VMs in such a scenario.

Userlevel 7
Badge +13

@JMeixnerWell the backup user could have only limited permissions on a certain container/folder, because of security reasons. On the other hand I think it's a very unlikely scenario that you're missing VMs in the backup on which you don't have access...😅


This is what I thought 😎

But it is possible… on the other hand, this can happen with PowerCLI, too.

You would not need to login to vSphere. So you do not need to take care about authentication.

Userlevel 7
Badge +20

great script!

 

question , can results be sorted out by name and not include powered off vms?

I see that you only use format as table and autosize

Thanks 

You could do this by doing a For-Each loop where the VM is equal to powered on only and then the format line can be changed to sort by name also.

Userlevel 7
Badge +20

got if , thank you 

updated #Read All VMs section with this 

# Read all VMs
$VMs = Get-VM | Where {$_.PowerState -match "On"} | select Name, MemoryGB, VMHost, Folder

 

and $results with

$result  | sort-Object -Property Name | ft -AutoSize 

 

I do have one result that detects a VM as non-backed up but it actually has a restore point that is 1024 days old , is there a timeframe or some threshold this will not look beyond ? 

 

 

 

Yeah just like that.  Nice work.  For the timeframe I would assume the seciton for Query Veeam Restore points would need to be tweaked for this.

Userlevel 7
Badge +20
# Read Credential-File
$WorkingDir = "C:\_install\script\"
$CredObject = Import-Clixml -Path ($WorkingDir + "CredObject.xml")

Hello! 

Could you help me, what Credential-File should I provide? 

 

You need to provide the CredObject.xml as noted in the code block above and in the directory noted.

Comment