Quantcast
Channel: The Official Scripting Guys Forum! forum
Viewing all articles
Browse latest Browse all 15028

Powershell SMO SQL Server Mirror Databases

$
0
0

Hello,

I am almost done writing a script to help my team manage mirrored database during planned outages.  I would like to do determine the role of the database (principal or mirror). If I query atheDMV sys.database_mirroring, I am able to determine the role of the database by looking at the mirror_role and mirror_role_desc columns.

http://technet.microsoft.com/en-us/library/ms178655(v=sql.110).aspx

Since I am using SMO objects I looked for their equivalents, but I could not find any.

http://msdn.microsoft.com/en-us/library/Microsoft.SqlServer.Management.Smo.Database_properties.aspx

Does anyone have any idea where I could find/determine this information using SMO?

Thank you


Viewing all articles
Browse latest Browse all 15028

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>