Excluded VMs List – Veeam SAMReport – PowerCli
Following on from my previous post showing a backup report for the past three or four days, another element of the same report that I produce is to list out the virtual machines that are excluded from the backups and their reason. This uses the VMware Tag capability… basically, any virtual machine that you want to be excluded from the report should have a Tag assigned to it which is part of the ‘Backup Tags’ category… any virtual machine with the ‘Backup Tags’ category assigned to it will be added to the list in this script.
Once again the script enclosed below is a a module that can be added to the ‘SysAdmin Modular Report’ that was created by ‘TheAgreeableCow’ and featured on Veeams community forums… links below:
http://www.theagreeablecow.com/2012/09/sysadmin-modular-reporting-samreports.html
http://forums.veeam.com/powershell-f26/sysadmin-modular-reporting-samreport-for-veeam-t13422.html
The concept behind SAMReport is taken from some of the work done by Alan Renouf with his vCheck Report: http://www.virtu-al.net/vcheck-pluginsheaders/vcheck/
Example of how the report displays:
[powershell]
Connect-ViServer $VMware_Server
$Title = "Excluded VMs in Woking"
$ResultsText = "These machines in Woking have been excluded for the following reasons"
$ResultsAlert = ‘Warning’
$newresult = @(get-tagassignment -Category ‘Backup Tags’ | select -property @{N=’VM’;E={$_.Entity}}, @{N=’Reason’;E={$_.Tag.Name}} | Sort Reason )
$ResultsData = $newresult
############################################################################################################
# Output #
#————————
$OutText = $ResultsText
$OutData = $ResultsData | Sort-Object VM
$OutAlert = $ResultsAlert
$Attachment = ""
[/powershell]