Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Administration
 Set up a SQL Server using Powershell

Author  Topic 

chris_cs
Posting Yak Master

223 Posts

Posted - 2011-06-28 : 11:07:31
Does anyone know if it's possible to use Powershell to install and configure a fresh installation of SQL Server?

Junior DBA learning the ropes

russell
Pyro-ma-ni-yak

5072 Posts

Posted - 2011-06-28 : 11:12:44
Never did it. See if these help.

http://technet.microsoft.com/en-us/library/dd347651.aspx

http://powershell.com/cs/forums/t/1487.aspx
Go to Top of Page

chris_cs
Posting Yak Master

223 Posts

Posted - 2011-06-28 : 11:17:10
Thanks for the reply.

I'll have a look at those links.

Junior DBA learning the ropes
Go to Top of Page

jackv
Master Smack Fu Yak Hacker

2179 Posts

Posted - 2011-07-05 : 01:42:35
Yes , it's possible. Do you have a silent install script ? If you do , then it would only be a few extra steps to have powershell manage the process.

Jack Vamvas
--------------------
http://www.sqlserver-dba.com
Go to Top of Page

Lumbago
Norsk Yak Master

3271 Posts

Posted - 2011-07-05 : 02:45:29
Yes you can, I've done it, and it's actually quite simple.

What you need is an installation .ini-file for all the configuration options and the easiest way to create it (there are at least a hundred options so creating it manually is a mess!) is to go through the regular installation using the installation wizard. Make all your needed configurations in the wizard and then all the way in the end at the very last step before that installation begins, there is a tiny window telling you the location of the .ini-file that is created for the configurations you have just created. Copy this file to somewhere safe and review it to make it fit your needs. The use sqlcmd from powershell to run the actual install:

http://thefirstsql.com/2010/06/09/using-sqlcmd-from-powershell/



- Lumbago
My blog-> http://thefirstsql.com/2011/02/07/regular-expressions-advanced-string-matching-and-new-split-function-sql-server-2008-r2/
Go to Top of Page

Lumbago
Norsk Yak Master

3271 Posts

Posted - 2011-07-05 : 02:49:04
...and then you run the install like this:

setup.exe /ConfigurationFile=ConfigFile.ini

- Lumbago
My blog-> http://thefirstsql.com/2011/02/07/regular-expressions-advanced-string-matching-and-new-split-function-sql-server-2008-r2/
Go to Top of Page
   

- Advertisement -