Finding the state of a replica

PowerShell script exchange

Finding the state of a replica

Veeam Logoby dcd62 » Fri Apr 03, 2015 7:10 pm

I want to script the process of checking a replication to see if it has the status of "Failover". Any ideas?
thanks
dcd62
Enthusiast
 
Posts: 29
Liked: 4 times
Joined: Wed Aug 20, 2014 1:00 pm

Re: Finding the state of a replica

Veeam Logoby v.Eremin » Mon Apr 06, 2015 10:13 am

What about this example?

Code: Select all
Get-VBRReplica | select name, {$_.GetObjectOibsAll().State}


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

Re: Finding the state of a replica

Veeam Logoby dcd62 » Mon Apr 06, 2015 2:56 pm

Thanks, that's exactly what I was looking for.
So I'm new to this and know how to list the members and methods, but have a couple of questions.
1. How would I find a description of what GetObjectOibsAll actually is
2. How would I find what the other options are besides .State?
dcd62
Enthusiast
 
Posts: 29
Liked: 4 times
Joined: Wed Aug 20, 2014 1:00 pm

Re: Finding the state of a replica

Veeam Logoby v.Eremin » Mon Apr 06, 2015 3:40 pm

We have a section of our Help Center devoted to PowerShell.

However, not all internal methods and properties of all objects are listed there (those are estimated at thousands). Thus, it's good old trial method - use Get-Help and Get-Member, and see what this of that particular object might propose to you.

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


Return to PowerShell



Who is online

Users browsing this forum: No registered users and 11 guests