Powershell Script to check if SQL is Installed

Posted on

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!

Advertisements

One thought on “Powershell Script to check if SQL is Installed

    Petr said:
    May 22, 2017 at 12:14 am

    Thanks!

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s