powershell to install sql server 2012

powershell to install sql server 2012

Installation Options

The Setup supports the following installation options while installing SQL Server 2012 on a Server Core operating system:
  1. Installation from Command Line
    To install specific features using the command prompt installation option, use the /FEATURES parameter and specify the parent feature or feature values. The following is an example of using the parameters from the command line:
    Setup.exe /qs /ACTION=Install /FEATURES=SQLEngine,Replication /INSTANCENAME=MSSQLSERVER /SQLSVCACCOUNT="<DomainNameUserName>" /SQLSVCPASSWORD="<StrongPassword>" /SQLSYSADMINACCOUNTS="<DomainNameUserName>" /AGTSVCACCOUNT="NT AUTHORITYNetwork Service" /TCPENABLED=1 /IACCEPTSQLSERVERLICENSETERMS
  2. Installation using Configuration File
    Setup supports the use of the configuration file only through the command prompt. The configuration file is a text file with the basic structure of a parameter (name/value pair) and a descriptive comment. The configuration file specified at the command prompt should have an .INI file name extension. See the following examples of ConfigurationFile.INI:
    Installing Database Engine
    The following example shows how to install a new stand-alone instance that includes the SQL Server Database Engine:
    ; SQL Server 2012 Configuration File
    [OPTIONS]

    ; Specifies a Setup work flow, like INSTALL, UNINSTALL, or UPGRADE. This is a required parameter.

    ACTION="Install"

    ; Specifies features to install, uninstall, or upgrade. The lists of features include SQLEngine, FullText, Replication, AS, IS, and Conn.

    FEATURES=SQLENGINE

    ; Specify a default or named instance. MSSQLSERVER is the default instance for non-Express editions and SQLExpress for Express editions. This parameter is required when installing the SQL Server Database Engine, and Analysis Services (AS).

    INSTANCENAME="MSSQLSERVER"

    ; Specify the Instance ID for the SQL Server features you have specified. SQL Server directory structure, registry structure, and service names will incorporate the instance ID of the SQL Server instance.

    INSTANCEID="MSSQLSERVER"

    ; Account for SQL Server service: DomainUser or system account.

    SQLSVCACCOUNT="NT ServiceMSSQLSERVER"

    ; Windows account(s) to provision as SQL Server system administrators.

    SQLSYSADMINACCOUNTS="<DomainNameUserName>"

    ; Accept the License agreement to continue with Installation

    IAcceptSQLServerLicenseTerms="True"

    Installing connectivity components
    The following example shows how to install the connectivity components:
    ; SQL Server 2012 Configuration File
    [OPTIONS]

    ; Specifies a Setup work flow, like INSTALL, UNINSTALL, or UPGRADE. This is a required parameter.

    ACTION="Install"

    ; Specifies features to install, uninstall, or upgrade. The lists of features include SQLEngine, FullText, Replication, AS, IS, and Conn.

    FEATURES=Conn

    ; Specifies acceptance of License Terms

    IAcceptSQLServerLicenseTerms="True

    Installing all supported features
    The following example shows how to install all supported features of SQL Server 2012 on Server Core:
    ;SQL Server 2012 Configuration File
    [OPTIONS]
    ; Specifies a Setup work flow, like INSTALL, UNINSTALL, or UPGRADE. This is a required parameter.

    ACTION="Install"

    ; Specifies features to install, uninstall, or upgrade. The lists of features include SQLEngine, FullText, Replication, AS, IS, and Conn.

    FEATURES=SQLENGINE,FullText,Replication,AS,IS,Conn

    ; Specify a default or named instance. MSSQLSERVER is the default instance for non-Express editions and SQLExpress for Express editions. This parameter is required when installing the SQL Server Database Engine (SQL), or Analysis Services (AS).

    INSTANCENAME="MSSQLSERVER"

    ; Specify the Instance ID for the SQL Server features you have specified. SQL Server directory structure, registry structure, and service names will incorporate the instance ID of the SQL Server instance.

    INSTANCEID="MSSQLSERVER"

    ; Account for SQL Server service: DomainUser or system account.

    SQLSVCACCOUNT="NT ServiceMSSQLSERVER"

    ; Windows account(s) to provision as SQL Server system administrators.

    SQLSYSADMINACCOUNTS="<DomainNameUserName>"

    ; The name of the account that the Analysis Services service runs under.

    ASSVCACCOUNT= "NT ServiceMSSQLServerOLAPService"

    ; Specifies the list of administrator accounts that need to be provisioned.

    ASSYSADMINACCOUNTS="<DomainNameUserName>"

    ; Specifies the server mode of the Analysis Services instance. Valid values are MULTIDIMENSIONAL, POWERPIVOT or TABULAR. ASSERVERMODE is case-sensitive. All values must be expressed in upper case.

    ASSERVERMODE="MULTIDIMENSIONAL"

    ; Optional value, which specifies the state of the TCP protocol for the SQL Server service. Supported values are: 0 to disable the TCP protocol, and 1 to enable the TCP protocol.

    TCPENABLED=1

    ;Specifies acceptance of License Terms

    IAcceptSQLServerLicenseTerms="True"

    The following table shows how you can launch the Setup using a configuration file.
    Installation option
    Examples
    Configuration file
    Following are some examples of how to use the configuration file:
    • To specify the configuration file at the command prompt:
    Setup.exe /QS /ConfigurationFile=MyConfigurationFile.INI
    • To specify passwords at the command prompt instead of in the configuration file:
    Setup.exe /QS /SQLSVCPASSWORD="************" /ASSVCPASSWORD="************"  /ConfigurationFile=MyConfigurationFile.INI
    DefaultSetup.ini
    If you have the DefaultSetup.ini file in the x86 and x64 folders at the root level of the SQL Server source media, open the DefaultSetup.ini file, and then add the Featuresparameter to the file.
    If the DefaultSetup.ini file does not exist, you can create it and copy it to the x86 and x64 folders at the root level of the SQL Server source media.
(Visited 101 times, 1 visits today)

Add a Comment

Facebook