PowerShell script exchange
Post Reply
mesiah70
Lurker
Posts: 1
Liked: never
Joined: Oct 01, 2020 7:08 am
Full Name: Haydar Tekir
Contact:

Search for SQL Backups

Post by mesiah70 »

Dear all,

I would like to know, if there is a chance to search the Veeam Backup LOGS against SQL Backup. I'm trying to figure out which servers are being backed up of sql Databases.
My issues is, that I have tons of servers which is not handy check them one by one. How can I achieve this via PS eventually?

Many Thanks

Haydar
HannesK
Product Manager
Posts: 14844
Liked: 3086 times
Joined: Sep 01, 2014 11:46 am
Full Name: Hannes Kasparick
Location: Austria
Contact:

Re: Search for SQL Backups

Post by HannesK »

Hello,
and welcome to the forums.

I don't have a good idea for powershell... but did you see, that if you use the restore button in the main ribbon -> vmware -> restore from backup -> application items restore -> SQL -> it only shows the VMs with SQL backups?

Maybe that's "good enough"?

Best regards,
Hannes
oleg.feoktistov
Veeam Software
Posts: 2010
Liked: 670 times
Joined: Sep 25, 2019 10:32 am
Full Name: Oleg Feoktistov
Contact:

Re: Search for SQL Backups

Post by oleg.feoktistov »

Hi Haydar,

You can get all the servers hosting SQL, which were backed up with application-aware processing with the cmdlet below:

Code: Select all

Get-VBRApplicationRestorePoint -SQL
You can then compose a simple report on which servers hosting SQLs were backed up with AAIP:

Code: Select all


# Get SQL restore points (backed up with AAIP)
$SQLs = Get-VBRApplicationRestorePoint -SQL

# Get all restore points
$RPs = Get-VBRRestorePoint

# Empty array. Contains a final report when the script is executed.
$totalBackedUp = @()

# Query each restore point from 2 arrays above and compare ids
foreach ($rp in $RPs) {
    foreach ($sql in $sqls) {
        if ($sql.Id -eq $rp.Id) {

# Add IsSQL = true if the server hosts SQL and is backed up with AAIP
            $totalBackedUp += $rp | select Id, Name, @{n='IsSQL';e={$true}}
        }

# Add IsSQL = false if it is any other server
        else {
            $totalBackedUp += $rp | select Id, Name, @{n='IsSQL';e={$false}}
        }
    }
} 
Thanks,
Oleg
jhoughes
Veeam Vanguard
Posts: 282
Liked: 113 times
Joined: Apr 20, 2017 4:19 pm
Full Name: Joe Houghes
Location: Castle Rock, CO
Contact:

Re: Search for SQL Backups

Post by jhoughes » 1 person likes this post

I actually covered this with a reporting script which will start sessions with the Explorer to investigate each.

It's up on VeeamHub here:
https://github.com/VeeamHub/powershell/ ... aseReports
Husband, Father, Solutions Architect, Geek | @DenverVMUG & @DenverPSUG leader | International Speaker | Veeam Vanguard | vExpert (PRO) | Cisco Champion
Post Reply

Who is online

Users browsing this forum: No registered users and 10 guests