PowerShell script exchange
Post Reply
dcd62
Enthusiast
Posts: 39
Liked: 4 times
Joined: Aug 20, 2014 1:00 pm
Contact:

Finding the state of a replica

Post by dcd62 »

I want to script the process of checking a replication to see if it has the status of "Failover". Any ideas?
thanks

veremin
Product Manager
Posts: 17834
Liked: 1662 times
Joined: Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin
Contact:

Re: Finding the state of a replica

Post by veremin »

What about this example?

Code: Select all

Get-VBRReplica | select name, {$_.GetObjectOibsAll().State}
Thanks.

dcd62
Enthusiast
Posts: 39
Liked: 4 times
Joined: Aug 20, 2014 1:00 pm
Contact:

Re: Finding the state of a replica

Post by dcd62 »

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?

veremin
Product Manager
Posts: 17834
Liked: 1662 times
Joined: Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin
Contact:

Re: Finding the state of a replica

Post by veremin »

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.

Post Reply

Who is online

Users browsing this forum: No registered users and 6 guests