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

Finding the state of a replica

Post by dcd62 » 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

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

Re: Finding the state of a replica

Post by veremin » Apr 06, 2015 10:13 am

What about this example?

Code: Select all

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

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

Re: Finding the state of a replica

Post by dcd62 » 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?

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

Re: Finding the state of a replica

Post by veremin » 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.

Post Reply

Who is online

Users browsing this forum: Nikolay.Stankevich and 10 guests