Scripting System Center
Matt Hansen  

Powershell Script to check if SQL is Installed

Reading Time: < 1 minute

Here we go, short but sweet. I had to come up with this today when working with a SQL Server compliance item in SCCM 2012 using a script detection method. I’ve added the else back in, but you can modify however you need.

if (Test-Path “HKLM:\Software\Microsoft\Microsoft SQL Server\Instance Names\SQL”) {
write-host “True”
} Else {
write-host “False”
}

 

I hope I’ve made your day, at least a little bit easier!

2 thoughts on “Powershell Script to check if SQL is Installed

  1. Petr

    Thanks!

  2. jdashn

    This was helpful! thanks!

Leave a Reply to PetrCancel reply

Discover more from Hansen Cloud

Subscribe now to keep reading and get access to the full archive.

Continue reading