In my first article, we talked about how we can make our SQL Server installation include every single patch and hotfix we plan to install. That process is called slipstreaming and it’s a huge timesaver, so if you missed it, jump
and take a look at it. I seriously believe it could be a game changer for you and how you do some of your work.
In this blog post I want to somehow enhance what we learned in that previous blog post by actually allowing ourselves to install SQL Server without even seeing the installation wizard! So imagine the following scenario – you work for an organization where everything should be standardized or probably you have 10 new SQL instances to be installed because of a business requirement. In both cases you want to install them as like they are created from a template, but you don’t want to lose time and go on each and every server, going through the next-next wizard in order to complete the request. The so called method of “unattended install” is here to save you. Let’s see what this means by actually using a both SQL Server 2012 and SQL Server 2014 media.
Every single time you are on your way to deploy a new instance, you go through the SQL installation wizard and at one point, just before you hit the “Install” button, you will be presented with a screen like this one:
What we are interested in on this screen is that “Configuration file path” field because that ConfigurationFile.ini file is actually the file that we are about to use for our installations. Let’s take a look at it. Here is where it is located – the same directory as the installer actually points you to.
Here is how the file itself looks like and what you will find in there:
As you can see from the file, there are a lot of parameters in here. At first glance it could even be a bit confusing. However, that’s not the case if you spend a bit of time on it and just explore it for a moment, so here is an idea for you – generate one such file on your machine, take a look at it and move on reading the remaining part of the article after that.
In general, what you will see depends on what features you selected during the installation wizard. Based on that you will have the needed parameters and the size of the text file may vary. Our idea here is to make a configuration file in such way that we will just need one cmd command and that will be enough in order for the instance to be deployed. So once you choose the parameters for the components, what accounts need to be used for each service, the collation, and all the others, what we need to do next is the following:
- Remove the UIMODE=”Normal” together with the comment above it
- Change the QUIET parameter to “True” instead of “False”
- Remove the ADDCURRENTUSERASSQLADMIN="False" together with the comment above it as we are not installing Express editions most of the times (if you are – keep that in the configuration file)
- Add IACCEPTSQLSERVERLICENSETERMS="True" somewhere in the file (for example at the top of it)
Once we do that you should be seeing something like this:
As you can see these are 2 of the parameters that we needed to add or change and the UIMODE one is now removed. However, take a closer look at this file because if you do, you will probably notice two more parameters that can be interesting to you – “UpdateEnabled” and “UpdateSource”. These are the ones that will help us prepare the Slipstreamed installation that we discussed in the previous topic, so if you are planning such – that’s the way you can configure it.
Once you have your file ready – save it at some folder somewhere on the server, upload or mount the installation media of SQL Server and start cmd.exe. What you need to input there is the following:
Path to the setup.exe /ConfigurationFile=”Path to the ConfigurationFile.ini”. In my case this looks like the line below:
So my SQL Server installation setup.exe is at D:\ and the ConfigurationFile.ini file that we just prepared is in C:\. Here is what you should see once you input this command:
That’s everything that you will see actually. There will be no wizard for you to go through and you just have to go and grab a cup of coffee and hopefully when you come back the SQL installation will be ready. What’s more, because we added the “UpdateEnabled” and “UpdateSource” parameters, our SQL instance will actually be patched to the level that we requested thus we are also skipping the process of going through the installation wizards of all the fixes that we planned. Isn’t that cool?
In summary, unattended installations of SQL Server are quite useful and can be of great help to you when you want to deploy instances that are based on templates. Also, if you have a request for more than 1 instance to be created, you can easily create one file (if you haven’t saved somewhere the ones that you used already before) and just run a simple command line script instead of going through all the installation wizards.
To finish with something even better – one Pro tip from me – create as many configuration files as you need in terms of your business environment. For example I have configuration files that I use when I am about to install only the DB engine and SSMS, I have one which helps me install all SQL Server features and I have one more which I use when I need to install SSIS, SSRS or SSAS (or a combination of those). Thus, when a request for a new instance is logged, I can easily fire up a new installation and not lose time on a task that can be not completely – but almost partially automated.
- Unattended installation of SQL Server - December 11, 2014
- Slipstreaming SQL Server 2012 and 2014 - November 12, 2014