recovery

    how to see veeam backups in powershell

    This allows you to see veeam backups for a specified server over the last week.

    The code

    Enter-PSSession yourveeamserver 
    Add-PSSnapin VeeamPSSnapIn 
    Get-VBRBackupSession | ? JobName -like "*yourtargetserver*" | ? endtime -gt $(get-date).adddays(-7) | 
        select jobname, jobtype, creationtime, endtime, result, state | sort-object -property jobname, endtime | 
        ft -AutoSize 
    

    Explanation

    Explaining this a little…..

    This line ‘remotes’ to the veeam server. Getting Powershell remoting set-up is another subject. I’d recommend the Powershell help topic about_remote_troubleshooting, if it doesn’t ‘just work’.

    Enter-PSSession yourveeamserver 
    

    This loads all the veeam cmdlets into memory

    Add-PSSnapin VeeamPSSnapIn 
    

    This line depends on your Veeam job having the name of the server you’re interested in, in the title. You can run a command to show which job backs up which database. I’ll perhaps post that soon.

    Get-VBRBackupSession | ? JobName -like "*yourtargetserver*" | ? endtime -gt $(get-date).adddays(-7) | 
        select jobname, jobtype, creationtime, endtime, result, state | sort-object -property jobname, endtime | 
        ft -AutoSize