< Blog

SQL Silent Install

Working at Enhansoft, I spin up a lot of VMs and install Configuration Manager 2007 and 2012. Since Configuration Manager requires SQL Server (we use 2008 and 2008 R2) we use the same setups time and again. Now this becomes tedious. Constantly going through the SQL setup to achieve the same end result. There has got to be an easier way to do this. And there was. SQL unattended silent install.

The following procedure is for SQL Server 2008 R2.

First step is to go though one initial setup, choosing your required configuration. You will eventually come the end of the setup with the following line:


Do not complete the setup at this point. Take note of the the location of the configuration file location; go there and copy the the configuration file to a safe location (a shared network drive for example). If you had closed the SQL install before coping the configuration file, the configuration file will have been deleted.Once that is done, you can safely close the SQL Server install windows.

Once the configuration file is safe, it has to be edited. The following should be set:

QUIET set to True

SQLSYSADMINACCOUNTS set this for your required Admins (or leave it if you set in the the initial setup)

Add PID and set the license key (this might not be needed if you product came with one preloaded)


ADDCURRENTUSERASSQLADMIN  – remove this entry, it applies only to SQL Server Express

UIMODE – remove this entry, does not work with quiet mode

INSTALLSHAREDDIR, INSTALLSHAREDWOWDIR, INSTANCEDIR – now when it comes to this 3 settings, they are up to your configuration, We install both Configuration Manager and SQL on D drives, not the default locations; which are normally the C drive.

The next step is to create a batch file to run the install. The following is what I have in mine, although a bit modified.

@echo off
echo Installing SQL Server 2008 R2
e:\setup /ConfigurationFile=\\Sharename\username\ConfigurationFile.ini

Note that I am using SQL Server  2008 R2 ISO and have inserted it into a VM, the batch file and configuration file are stored on a share.