Install SQL Express 2014 or 2016 from PowerShell

This may be useful for some folks out there. While the documentation on SQL Books online for command line installs is extensive, the examples there are limited, and the troubleshooting steps are not described clearly.

You will need to download the SQL installer iso or files and mount or extract them, and locate the setup.exe.

For SQL 2014 Take note that:

  1. This is installing SQL Express, a /FEATURES parameter was not required. Changes will be required if using a different distribution.
  2. This creates a default instance of SQL, change MSSQLSERVER to your desired instance name.
  3. Local Windows administrators will have SQL access by default
  4. The line of PowerShell code below that defines $params has no carriage returns between the single quotes.
  5. The results of a successful or failed install can be found in the folder: “$env:ProgramFiles\Microsoft SQL Server\###\Setup Bootstrap”, where ### is 120 for SQL 2014, 130 for SQL 2016.
#Set-Location to where your SQL Setup.exe is located, then run:
$params = @'
/ACTION=Install /FEATURES=SQL /INSTANCENAME=MSSQLSERVER /QS /HIDECONSOLE /INDICATEPROGRESS="True" /IAcceptSQLServerLicenseTerms /SQLSVCACCOUNT="NT AUTHORITY\NETWORK SERVICE" /SQLSYSADMINACCOUNTS="builtin\administrators" /SKIPRULES="RebootRequiredCheck" 
'@ 
Start-process .\setup.exe $params -wait

For SQL 2016, I’m experimenting with SQL 2016 Enterprise Evaluation, and this worked as well:

#Set-Location to where your SQL Setup.exe is located, then run:
$params = @'
/ACTION=Install /QS /FEATURES=SQL /INSTANCENAME=MSSQLSERVER /HIDECONSOLE /INDICATEPROGRESS="True" /IAcceptSQLServerLicenseTerms /SQLSVCACCOUNT="NT AUTHORITY\NETWORK SERVICE" /SQLSYSADMINACCOUNTS="builtin\administrators" /SKIPRULES="RebootRequiredCheck" 
'@ 
Start-process .\setup.exe $params -wait

Social

Content

Speaking

All Rights Reserved Theme by 404 THEME.