Skip to main content
Matrix42 Self-Service Help Center

PSADK Package: SQL-Server

This PSADK based package installs SQL Server 2014/2016/2017 on your Serversystem. It can be used to automate the Installation very easy but having the most options to configure SQL Server available as Parameters.

You can run the package several times on a Serversystem to install multiple instances.

Further Information in SQL Server v03 (en).pptx

Available Parameter

  • Package Name: Microsoft_SQLServer_x64_en_v02.
  • Input Parameters for Feature
    • -FeatureSQL: Installs the SQL Server Engine
    • -FeatureREP: Installs the SQL Replication
    • -FeatureFTS: Installs the Full-text search
    • -FeatureBC: Installs the Backward compatibility components
    • -FeatureBOL: Installs Books online
    • -FeatureCN: Installs the connectivity components
    • -FeatureMS: Installs the Basic manamgement tools
    • -FeatureAMS: Installs the advanced Management tools
    • -FeatureCDK: Installs the Client SDK
    • -FeatureSDK: Installs the SQL Server SDK
  • Input Parameters for General Settings
    • -InstallUpdates [NoUpdates|Online|Path]: If you select „Path“, the Setup will search in the sub-Directory „Files\upd“ Directory for updates for SQL Server.
    • -InstanceId <string>: Defines the InstanceID which should be used to install SQL Server.
    • -InstanceName <string>: Defines the instance name which should be used to install SQL Server.
      • Both Parameter „Instance-Name“ and „Instance-ID“ are optional for Installation. If the Parameter is not given, the script tries to install a Default instance. If the instance already exist, the script will Exit before starting the Installation.
      • If you uninstall a SQL Server Instance, you must provide one of the both Parameter. Before the script starts the install/uninstall of SQL-Server it will check if the instance exist and will skip before starting the uninstall.
    • -LicenseKey <string>: Specifies the License Key
    • -SqlSecurityMode: Aktivates the SQL Server security mode. If it is not specified, just the Windows Authentication will be activated.
    • -Collation <string>: Defines the collation that should be configured for the SQL Server Instance. If not specified, the collation will be configured regarding the unerlying Operation System.
    • -SysAdmin <string>: Configures the initial SQL Server Administrator. Can be a local or Domain Group or user (Domain\User). If this Parameter is not set, the Installation user will be used. If the Installation user is „SYSTEM“ the script will determine the local Administrator account by it’s SID.
    • -SAPassword <string>: If you  have activated the SQL-security-mode, you can specify the sa Password here.
    • -NamedPipes: Activates NamedPipes.
    • -TCP: Activates TCP.
  • Input Parameters for Service Settings
    • -AgentAccount <string>: Domain/User.
    • -AgentPassword <string>: The Password for the Agent Service..
    • -AgentStartType [Automatic|Disabled|Manual]: The Startup type for the Agent.
    • -ServiceAccount <string>: Domain/User.
    • -ServicePassword <string>: The service Password.
    • -ServiceStartType [Automatic|Disabled|Manual]: The Startup type for the service.
    • -BrowserStartType [Automatic|Disabled|Manual]: The Startup type for the browser service.
  • Addititional Todo
    • Copy the content of the SQL Server Installationmedium to „Files\sql“.
    • Copy all updates you want to install during the Setup to „Files\upd“.
    • Copy the Content fo the sxs Directory of your Windows Server 2012 R2/ 2016 Installation Medium to the „Files\sxs“ Directory, if you want to automatically install .NET Framework 3.5 if needed.
  • Current Version: 2
  • Download of package: see Attachments

Special tip to use it with Matrix42 Enterprise Manager for SCCM:

Create the SCCM Deployment Type just with the basic Input Parameters for running the script (Deploy-Application.exe -DeploymentType Install) and add a variable in EM for every Input-Parameter of the script. Then you can perfectly delegate the Installation of SQL Server with EM to your Server-Administration Team.

Here an example for Administrator-Based variables.

Bild1.JPG

Examples

# Installation of SQL Server with windows authentication and use of locally logged in user
. $script -DeploymentType Install -FeatureSQL -InstanceName „Test_a“

# Simple installation of SQL Server with SQL Server Security Mode and defined Sysadmin account
. $script -DeploymentType Install -FeatureSQL -InstanceName „Test_b“ -SqlSecurityMode -SAPassword „Coffee2Go“ -SysAdmins „perfectbeer\app_sql_admins“

# Simple installation of SQL Server with TCP enabled, defined Sysadmin account and service autostart
. $script -DeploymentType Install -FeatureSQL -InstanceName „Test_c“ -TCP -Collation SQL_Latin1_General_CP1_CI_AS -ServiceStartType Automatic

# Installation of SQL Server with customized paths
. $script -DeploymentType Install -FeatureSQL -InstanceName „Test_d“ -InstanceDir „c:\SQLServerTest\Test$($testCycle)d“

# Installation of SQL Server with more customized paths
. $script -DeploymentType Install -FeatureSQL -InstanceName „Test_e“ -InstanceDir „c:\SQLServerTest\Test$($testCycle)e\Instance“ -SqlDataDir „c:\SQLServerTest\Test$($testCycle)e\SQLDataDir“ -SqlBackupDir „c:\SQLServerTest\Test$($testCycle)e\SQLBackupDir“ -SqlTempDBDir „c:\SQLServerTest\Test$($testCycle)e\SQLTempDBDir“ -SqlTempLogDir „c:\SQLServerTest\Test$($testCycle)e\SQLTempLogDir“ -SqlUserDBDir „c:\SQLServerTest\Test$($testCycle)e\SQLUserDBDir“ -SqlUserLogDir „c:\SQLServerTest\Test$($testCycle)e\SQLUserDBLogDir“

ReleaseNotes Version 2

  • Feature: Script is tested with windows 10
  • Feature: Script is tested with SQL Server 2016 and 2017
  • Feature: Handle SQL Setup Returncode 2068643838 as success (All selected features are already installed)
  • Change:  Removed SysAdmins, Update, PID, SecurityMode, SAPWD, Collation, Protocols and InstanceId from parameter creation when FeatureSQL is not selected or Uninstall is selected
  • Change:  Replaced all „Exit“ calls by „Exit-Script“ which will clenup the system and handle balloon popup, reboot and applocker
  • Change:  Replaces Get-WindowsFeature CmdLet by Get-WindowsOptionalFeature th enable support on Windows 10 clients also.
  • Feature: The input for the collation parameter is now checked, based on $dirFiles\Collation\SQLCollation_xxxx.csv (list created with select name, COLLATIONPROPERTY(name, ‚CodePage‘) as Code_Page, description from sys.fn_helpcollations()).
  • Change:  Simplified Code
  • Feature: Improved logging

 This package is not officially supported by Matrix42, Microsoft or the Author of this site. Usage on your own risk.

  • Was this article helpful?