Now imagine, you have multiple SQL Server 2012 instances to install with the same configuration on the multiple servers and you want this task to be done as quickly and consistently as possible. When this is the case, you may choose the unattended installation option. SQL Server unattended installation option lets administrators install SQL Server on multiple machines with little or no user interactions. SQL Server 2012 unattended installations can be done using command line parameters or configuration files. All SQL Server step-up screen entries and the dialog responses are made automatically by using information stored in the configuration file or by command-line parameters.
This article shows you the steps to perform unattended installation of SQL Server 2012 on a Windows Server 2008 system by using command line and configuration file.
Unattended SQL Server 2012 Installation From the Command Line
Follow the steps below, to perform new unattended installation of SQL Server 2012 instance on a Window Server 2008 from the command line:
- Logon to server as Administrator and then start the Command Prompt or Start the Command Prompt with elevated administrative privileges by right-clicking the Command Prompt icon in Programs list, and then click Run as Administrator:
Path: Start > All Programs > Accessories > Command Prompt
The Command Prompt window opens:
- The following is the command syntax which you can use to perform the unattended installation of SQL Server Database Engine and SQL Server Management Studio tools:
<Installation media location>\setup.exe /ACTION=install /QS /INSTANCENAME="<MachineName\InstanceName>" /IACCEPTSQLSERVERLICENSETERMS = 1 /FEATURES=SQLENGINE,SSMS /SQLSYSADMINACCOUNTS = "<YourDomain\Administrator>"
These command parameters are explained as follow:
Indicates the action to be performed.
Indicates that Setup runs and shows the installation progress. It accepts no input.
Indicates required instance name.
Required to acknowledge acceptance of the license agreement.
Required to specify individual SQL Server components to install.
Required to specify members of the sysadmin role.
Click here to view the complete list of command line parameters.
I executed the following command in the command line to perform stand-alone installation of SQL Server 2012 instance called UnattendedCmd, with the SQL Server Database Engine, Replication, and Full-Text Search components:
F:\setup.exe /ACTION=install /QS /INSTANCENAME="UnattendedCmd" /IACCEPTSQLSERVERLICENSETERMS=1 /FEATURES=SQLENGINE,SSMS /SQLSYSADMINACCOUNTS="IITCUK\SQLAdministrator"
Once the installation is completed, Launch SQL Server Configuration Manager or connect to instance via SQL Server Management Studio to verify installation (see below):
Unattended SQL Server 2012 Installation From a Configuration File
- The first step of the process is to create a configuration file which the SQL Server 2012 installer will use to answer all installation questions in a silent mode. To do that, insert the SQL Server installation media or locate the installation media on the network share. From the root folder, double click Setup.exe.
- This Launches SQL Server Installation Center. Specify the options and parameters for your SQL Server 2012 installation by following the setup wizard until the Ready to Install screen and then simply cancel the installation at Ready to Install screen (see below):
Remember: Make a note of the configuration file path on this final screen.
Open Windows Explorer and navigate to the folder where the configuration file is found:
Search ConfigurationFile.ini and copy it to a folder that can be used for unattended installations. For the purpose of this demo, I’m copying it to D:\ConfigurationFiles\ (see below):
- Now modify ConfigurationFile.ini to prepare the file for unattended installation:
- Set –
- Add –
- Set –
- Remove –
- Remove –
- Set –
- The last step is to use the configuration file with the command prompt for an installation of SQL Server 2012. To do that, open a command prompt and navigate to the location of the installation media and then execute the following command to perform the unattended installation of SQL Server 2012 using ConfigurationFile:
<Installation media location>\Setup.exe /ConfigurationFile=<Configuration file location> /Q
- Once the installation is completed, Launch SQL Server Configuration Manager or connect to instance via SQL Server Management Studio to verify installation.
I hope you will find the information of this post useful 🙂