Scripting SharePoint installation and configuration


This is the first post in a series of posts related to Mark Broadbent (B|T) and my preconference at SQL Saturday Cambridge on September 12th 2015.

These posts are extracts of what you might expect from our whole day of preconference. Please have a look at Implementing Business Intelligence & SharePoint High Availability Solutions for more details and how to register.

One of the first thing that we will have take a shot at in the preconference is how to build a SharePoint farm in a controlled manner, and how to be able to repeat this build again and again across environments.

Near-unattended installation

When installing and configuring a SharePoint farm – and I’ve installed and configured my fair share of farms – you want several things :

  • Document the installation
  • Be able to repeat the process
  • Drink coffee instead of looking at the screen
  • Make sure your database server isn’t spawned with funky looking database names like below

Documented and repeatable installation and configuration

Probably the most important part of the process. You might have to deliver a document to your SharePoint farm admin to show what you’ve done so it is repeatable in a production environment. You might want to save the document in some project documentation for future use, for referencing the user accounts used and so on.

In every case you are probably better off with a script than with a word document with a bunch of screen dumps and 287 steps to follow before you succeed. There are a lot of (franken-)scripts out there that use PowerShell. And SP gurus like Zach Rosenfield’s blogJos Verlinde’s script , Gary Lapointe’s Enterprise Search script functions have now established that PowerShell is the automation language for SharePoint.

Codeplex being an excellent source of reference for nice tools, SharePoint is not an exception and this is where you find : : My tool of predilection for installing SharePoint.

From the introduction to the project :

This project consists of PowerShell scripts, an XML input file, and a standard windows batch file (to kick off the process) which together provide a quick and near-unattended installation and initial configuration (Service Apps, My Sites) of Microsoft SharePoint Server 2010/2013. Works on Windows 2008 (though I hardly test on that OS these days), 2008 R2 and Windows 2012 / 2012 R2 (x64 only of course).

Basically it reads from an XML file with all the information necessary for setting up your SharePoint farm.

UI available

Being able to write a script is cool, having a UI to write the xml file is cooler. Doing it with a web interface is coolest !!

Previously there was a downloadable UI for autospinstaller : It is now deprecated but still usable. The people behind the UI now recommend to use a web interface available at

This is great if you have internet access (no information is send to their server, but I don’t feel comfortable writing all my setup information on a website) but if you don’t have access to the internet you can still get the “offline” GUI.

The configuration there is rather simple. You need to gather information before you can start. At least the usernames for the farm, the service and some other managed accounts. You need the name of the sql server. I always use an alias is it makes it much easier to move databases around without having to worry about SharePoint.

Once it is done you can save this XML to a document and run autospinstaller locally, pointing at the xml file.

I had to struggle a bit to get the alias part running, running cliconfig and create the alias myself and then ignore warnings from the autospinstaller (you can also change the Create attribute on the DBAlias element of the config file to false)

Here is how my alias look like.

Remember to open the firewall outbound and inbound ports and do some tesing with creating a file dsn or with ssms.

Make SharePoint follow your conventions not the other way round

After running the autospinstall script you should see databases beginning to popup in ssms and after a while (25 mins on my VM) it should come with a nicely formatted completed status message. Super green !!

And database names following a convention of my choice rather than a guid.


This is in my opinion the easiest way to setup a farm in a consistent manner. Furthermore the XML document can be kept as documentation of what was installed and how it was configured.

The next post will be a detailed walkthrough of how to use aliases for SharePoint databases.

Happy SharePointing !!

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: