Listing all the times all VMs were replicated

PowerShell script exchange

Listing all the times all VMs were replicated

Veeam Logoby marius roma » Sun Oct 25, 2015 11:03 am

In order to perform statistic analysis I need to create a job to list all the times all VMs were replicated or at least the last 50 time each VM was replicated, regardless of the job.
For each time a given VM was replicated I need to record the start and end time and the rersult (Success, warning, failed...).
The task could be described as something like "For each VM in each job list all the times the VM was replicated".
I made some tests but the results I get are not complete, so I presume I am getting the wrong data.
Is there any sample script I can start from?
Regards
marius
marius roma
Expert
 
Posts: 317
Liked: 3 times
Joined: Wed Feb 01, 2012 12:04 pm
Full Name: Mario

Re: Listing all the times all VMs were replicated

Veeam Logoby v.Eremin » Tue Nov 03, 2015 4:54 pm

Should it be a list of replicated VMs that still have restore points or more like historical report that will provide information regarding even those VMs that already have no replication restore points?
v.Eremin
Veeam Software
 
Posts: 13266
Liked: 968 times
Joined: Fri Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin

Re: Listing all the times all VMs were replicated

Veeam Logoby marius roma » Wed Nov 04, 2015 7:47 am

The second Solution would be far better...
Regards
marius
marius roma
Expert
 
Posts: 317
Liked: 3 times
Joined: Wed Feb 01, 2012 12:04 pm
Full Name: Mario

Re: Listing all the times all VMs were replicated

Veeam Logoby v.Eremin » Thu Nov 05, 2015 12:14 am 1 person likes this post

Unfortunately, I'm out of the office at the moment (on a sick leave, actually), so, I can only propose the algorithm that I'd implement.

Firstly, I'd get the list of all sessions, using Get-VBRBackupSession commandlet.

Secondly, I'd filter out those that are not replication ones (type is not equal to replica) via where-object commandlet.

Thirdly, I'd leverage Get-VBRTaskSession commandlet to get all VMs specific sessions within replication job sessions.

Fourthly, I'd select specific properties out of the list of existing task session, like VM name, result, start and end time.

Fifthly, I'd format the output a bit, so that, information is shown in required order (all sessions specific to first VM, then, to second, etc.)

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


Return to PowerShell



Who is online

Users browsing this forum: Yahoo [Bot] and 6 guests