03. Server Core Installation

Windows Server Core only allows CLI.

Run setup.exe under PowerShell

/IACCEPTSQLSERVERLICENCETERMS
/ACTION
/FEATURES
/ROLE
/INSTANCENAME
/SQLSYSADMINACCOUNTS
/AGTSVCACCOUNT
/SQLSVCACCOUNT
/qs unattended installation

Available actions:

.\setup.exe
Get-Service-DisplayName "instance"
Select objectname, displayname,status
Install sqlserver module (individual SSMS) or download from PS Gallery
Find Module sqlserver
Install-Module sqlserver
Invoke-Sqlcmd -serverinstance "host\inst" - query "SELECT @@SERVERNAME"

## Troubleshooting

```text
pgm file\Microsoft SQL Server\150\
    Setup Bootstrap\Log\
        Summary.txt
        YYYYMMDD_HHMM\
            Detail.txt
            System Configuration Check Report.txt
find /i error exceptionDatastore settings.xml
    config files
    *.log "Return value 3"
    some of them are expected

Product Update replaces deprecated slipstream functionality (install).

SS 2017 - no more SP, only CU and GDR:

To use product update:

/UPDATEENABLED=1 or True
/UPDATESOURCE=
    Microsoft Update
    WSUS service
    release patch
    UNC of N/W share

Allows installation to apply CU in build

$parameters = @[
    ServerInstance = '...'
    Query = "SELECT @@SERVERNAME,@@VERSION"
    ]

Invoke -sqlcmd @parameters

Can mix configuration file and command parameters.