How To Completely Uninstall/Remove All Versions of SQL Server and related tools/docs

  1. Download get-installedapp.ps1
  2. Load PowerShell ISE and execute the following:
    .\get-installedapp -appname "*SQL*SERVER*" -matchall |  select-object -expandproperty AppID |   foreach-object { "msiexec /x ""$_""" } > uninstall.bat
  3. Run the generated uninstall.bat

 

To see what applications the above command would remove, run this first:

.\get-installedapp -appname "*SQL*SERVER*" -matchall  | select-object AppName,AppID

References:

 

https://social.technet.microsoft.com/Forums/scriptcenter/en-US/0a01e7e1-babf-44d0-9b3a-6d0916a5e6b7/uninstall-sql-2008-r2-with-powershell?forum=ITCG

http://windowsitpro.com/scripting/auditing-32-bit-and-64-bit-applications-powershell

http://sqlblog.com/blogs/rob_farley/archive/2011/05/24/powershell-script-to-help-uninstall-sql-server-2008-r2-evaluation-edition.aspx