Script to Verify VM's are backed up?

PowerShell script exchange

Re: Script to Verify VM's are backed up?

Veeam Logoby Geoffroi » Tue Apr 21, 2015 1:43 pm

Hi Glamic,

Honestly I didn't tried to run on an other server. The issues is that VEEAM PowerCLI doesn't allow to remote connect to a VEEAM server like VMWARE PowerCLI.

See this topic : http://forums.veeam.com/powershell-f26/connect-to-remote-veeam-backup-server-with-powershell-t7443.html

As suggested in this topic, you could try to use

Code: Select all
Invoke-Command -ComputerName "VBR-01" -ScriptBlock "asnp VeeamPSSnapin; #some code, using semicolons instead of line breaks#"


To execute "Get-VBRBackupSession"

Unfortunately I'm not able to test because only my VEEAM host is in Windows
Geoffroi
Lurker
 
Posts: 2
Liked: 3 times
Joined: Mon Mar 23, 2015 3:43 pm
Full Name: Geoffroi Genot

Re: Script to Verify VM's are backed up?

Veeam Logoby michaelryancook » Fri May 01, 2015 8:04 pm

Hi Geoffroi. I am curious where your script gets $FullVM from as I don't see that anywhere else in your script or in vCheck.
michaelryancook
Expert
 
Posts: 113
Liked: 14 times
Joined: Tue Nov 26, 2013 6:13 pm
Full Name: Michael Cook

Re: Script to Verify VM's are backed up?

Veeam Logoby michaelryancook » Fri May 01, 2015 9:42 pm

Nvm, I had not run vCheck yet.
michaelryancook
Expert
 
Posts: 113
Liked: 14 times
Joined: Tue Nov 26, 2013 6:13 pm
Full Name: Michael Cook

Re: Script to Verify VM's are backed up?

Veeam Logoby michaelryancook » Thu May 14, 2015 8:05 pm

In the section below, shouldn't it be "$Result | where {$_.backed_up -eq $false}"?

As $VMObj.backed_up = $true when the VMs status is not equal to failed. Then the result is currently looking for when $_.backup_up = $true to display the unprotected VMs. When it shoudl be looking for $_.backed_up = $false to display unprotected VMs.

Code: Select all
# Find all successfully backed up VMs in selected sessions (i.e. VMs not ending in failure) and update status to "Protected"
foreach ($session in $vbrsessions) {
    foreach ($vm in ($session.gettasksessions() | Where-Object {$_.Status -ne "Failed"} | ForEach-Object { $_ | Select-object @{Name="VMname";Expression={$_.Name}}})) {
      $VMObj = $Result | where {$_.VMName -eq $vm.VMname }
      if ($VMObj){
         $VMObj.backed_up = $true
      }
    }
}

$Result | where {$_.backed_up -eq $true}
michaelryancook
Expert
 
Posts: 113
Liked: 14 times
Joined: Tue Nov 26, 2013 6:13 pm
Full Name: Michael Cook

[MERGED] : Powershell - Identify VM's not added to a Backup

Veeam Logoby mobyzone » Thu Jun 04, 2015 2:12 pm

Hi there,

Does anyone know if it is possible to do a scan on vCenter for all VM's and see if they are added into a backup job? Reason being we have around 300 VM's and we had an issue with one of the VM's that needed to be restored but it wasn't being backed up at all.

Is it possible using powershell that I can run a scheduled task daily?

Thanks
mobyzone
Lurker
 
Posts: 1
Liked: never
Joined: Thu Jun 04, 2015 2:07 pm
Full Name: Dan

Re: Script to Verify VM's are backed up?

Veeam Logoby v.Eremin » Thu Jun 04, 2015 2:43 pm

Hi, Dan,

Kindly, see the scripts provided in this topic; should be something you're looking for.

Thanks.
v.Eremin
Veeam Software
 
Posts: 13290
Liked: 971 times
Joined: Fri Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin

[MERGED] : How to list all backup points for a Guest

Veeam Logoby Brad.Morris » Mon Jan 18, 2016 9:35 pm

Hi there,

I would like to know how I can get a report of all the backup points for a particular server from all backup sources.

For example.
I have a server called Server1. I have several different backup jobs that have backed this server up over time. So if I go into Backups and search for Server1. I can see several jobs that have backed this server up. And each job might have several restore points.

What I would like to do is to be able to run a script that will report back to me a list of all the jobs and restore points in those jobs for this server.

Hope this makes sense.

Thanks,
Brad.
Brad.Morris
Enthusiast
 
Posts: 43
Liked: 2 times
Joined: Mon Sep 01, 2014 10:29 pm
Location: Melbourne, Australia
Full Name: Brad Morris

Re: Script to Verify VM's are backed up?

Veeam Logoby v.Eremin » Tue Jan 19, 2016 10:54 am

Check either Protected VMs report available in Veeam ONE or one of the scripts provided above and see whether it meets your expectations. Thanks.
v.Eremin
Veeam Software
 
Posts: 13290
Liked: 971 times
Joined: Fri Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin

Re: Script to Verify VM's are backed up?

Veeam Logoby albertwt » Thu May 18, 2017 1:07 pm

Gatoo wrote:Hi,

I tried the dev script and everything works perfect! No more errors. Exclusions are ok, colors ok.

Some adds possible :
- Sort the result in alphabetical order (A-Z)
- Mail sending
- Export to html

Congrats!


Which script was working ?
--
/* Veeam software enthusiast user & supporter ! */
albertwt
Expert
 
Posts: 607
Liked: 19 times
Joined: Thu Nov 05, 2009 12:24 pm
Location: Sydney, NSW

[MERGED] Get list of VMs protected - by host

Veeam Logoby battles » Wed May 24, 2017 7:10 pm

Hello,

I'd like to get a quick list of VMs that are currently getting backed up with Veeam - split out by host since we have many hosts connected to the Veeam B&R server.

TIA
battles
Service Provider
 
Posts: 28
Liked: 1 time
Joined: Fri Apr 07, 2017 2:03 pm
Full Name: Battles

Re: Get list of VMs protected - by host

Veeam Logoby vmniels » Wed May 24, 2017 9:08 pm

There are multiple posts about this subject already; have a look at post241577.html?hilit=vm%20backed%20up#p241577
VCP-DCV
Veeam Certified Engineer
http://foonet.be
vmniels
Veeam Software
 
Posts: 1516
Liked: 328 times
Joined: Mon Jul 15, 2013 11:09 am
Full Name: Niels Engelen

Previous

Return to PowerShell



Who is online

Users browsing this forum: No registered users and 8 guests