Save-sqmConfigBaseline
Configuration
sqmSQLTool v1.9.202.0+ · Save
sys.configurations (configured value, active value, is_dynamic, is_advanced) plus the global trace flags, with metadata (server, product version, capture time, label) as a JSON file.
Keep one baseline per major version (the major version is part of the file name) and check each instance only against the baseline of its version with Compare-sqmConfigBaseline.
Not captured: database options, startup parameters and settings that only exist through
ALTER SERVER CONFIGURATION. Trace flags need VIEW SERVER STATE (SQL Server 2022 and later: VIEW SERVER PERFORMANCE STATE); without it they are left empty and skipped during the comparison.
Parameters
| Parameter | Type | Required | Default | Notes |
|---|---|---|---|---|
| -SqlInstance | string | Required | — | Instance to capture. |
| -SqlCredential | PSCredential | Optional | — | Optional SQL login. |
| -Label | string | Optional | — | Free text stored in the file, for example Standard 2019 or after patch day. |
| -OutputPath | string | Optional | <module output path>\ConfigBaseline | Target folder; created if missing. |
| -EnableException | switch | Switch | $false | Throw instead of logging and returning $null. |
Execution Flow
Examples
Save a baseline with a label
Save-sqmConfigBaseline -SqlInstance "SQL01" -Label "Standard 2019"
Save into a shared folder and check another instance right away
$b = Save-sqmConfigBaseline -SqlInstance "SQL01" -OutputPath "D:\Baselines" Compare-sqmConfigBaseline -BaselinePath $b.BaselinePath -SqlInstance "SQL02"