Get-sqmServerSetting
Configuration
sqmSQLTool v1.8.2+ · Utility
-All to return all properties at once.
Supported properties include:
BackupDirectory, DefaultFile, DefaultLog, MasterDBPath, ErrorLogPath, ComputerName, InstanceName, Edition, VersionString, ProductLevel, ProductUpdateLevel, HostPlatform, IsClustered, IsHadrEnabled.
Parameters
| Parameter | Type | Required | Default | Notes |
|---|---|---|---|---|
| -SqlInstance | string | Optional | $env:COMPUTERNAME | Target SQL Server instance. |
| -SqlCredential | PSCredential | Optional | — | Credentials for the connection. |
| -Name | string | Optional | — | Single property name (ValidateSet). Returns scalar value. |
| -All | switch | Optional | $false | Return all properties as [PSCustomObject[]] (Name, Value, Type). |
| -DefaultValue | string | Optional | — | Fallback value if property doesn't exist (ignored with -All). |
| -EnableException | switch | Optional | $false | Re-throw exceptions instead of Write-Error. |
Execution Flow
Examples
Read a single property (BackupDirectory)
$backupPath = Get-sqmServerSetting -Name "BackupDirectory"
List all instance properties
Get-sqmServerSetting -All
Get all properties from remote instance with credentials
$cred = Get-Credential Get-sqmServerSetting -SqlInstance "SQL01" -SqlCredential $cred -All