PowerShell Tip of the Week: SQL Server Native Client version

Recently I had to extract SQL Server Native Client version from all of my SQL machines. I would like to share simple script for extracting that information remotely from registry. SQL Server Native Client To find version using PowerShell we need to know where is it located. Easiest way for me was extracting this from registry: SQL Server 2008/2008 R2:– HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SQL Server\SQLNCLI10\CurrentVersion SQL Server 2012/2016:– HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SQL Server\SQLNCLI11\CurrentVersion You …

How to get SQL server database synchronization status (High Availability) using PowerShell?

While working in large scale environments High Availability in SQL server database is definitely must have. Today I want to show you have to get SQL server database synchronization status using SQLPS. To get access to SQL server information you need to import first dedicated PS module – Import-Module SQLPS . Please remember to specify your SQL servers and correct SQL paths: Final script:

Execution of Powershell SQL queries

In one of the project I was working for, I was asked to create general function which can help with executing Powershell SQL queries. I prepared Powershell function which as an input need SQL server, database and query which should be executed. If database is located on specific instance remember to provide it as a part of SQL server parameter in format SQLServer\Instance As a result table with filtered rows …