PowerShell script exchange
Post Reply
tsukraw
Enthusiast
Posts: 46
Liked: 2 times
Joined: Jul 06, 2012 8:28 pm
Full Name: Tucker Sukraw
Contact:

Simple Powershell command for replication status

Post by tsukraw »

Hey Guys,
So i have absolutely no powershell experience and wondering if anyone can help me come up with a simple script. I've looked around the forums and haven't found quite what i am looking for.
All i want is a script that simply tells me the status of a replication job (Success/Warning/Fail)
That simple answer we are going to output to a csv/txt file.

We have a MySql database/web interface that we use with a number of other programs for alerts/monitoring.
So like the other programs we would daily have that csv/txt file imported into the database as part of a general successful/warning/failed replication history.

Would it be easy to make such a script to provide that simple answer output?
I suppose there should maybe be a start/end time stamp on the output as well so we know were getting current outputs.

thanks
Tucker Sukraw
Network Architect
West Central Technology
damadhatter
Service Provider
Posts: 53
Liked: 2 times
Joined: Feb 21, 2014 5:15 am
Full Name: Chris A
Contact:

Re: Simple Powershell command for replication status

Post by damadhatter »

Are you speaking of Labtech by chance?
veremin
Product Manager
Posts: 20282
Liked: 2257 times
Joined: Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin
Contact:

Re: Simple Powershell command for replication status

Post by veremin »

The latest replication job result can be gotten via .GetLastResult() method:

Code: Select all

Asnp VeeamPSSnapin
$Job = Get-VBRJob -name "Name of your replication job"
$Job.GetLastResult()
If you're after listing the job statuses of all replication jobs, then, you will have to write a cycle, within which the statuses will be listed along with the replication job names.

Thanks.
Post Reply

Who is online

Users browsing this forum: No registered users and 16 guests