Get-sqmTempDbRecommendation
Configuration
sqmSQLTool v1.8.2+ · Best Practices
Checks:
• File count: compares against CPU core count (ideal: min of CPU cores and 8)
• File sizes: alerts if unequal
• Autogrow: recommends MB-based growth instead of percent
• Drive placement: recommends separate drives if all files are on the same drive
Returns status (OK / Warning / Info) and list of recommendations.
Parameters
| Parameter | Type | Required | Default | Notes |
|---|---|---|---|---|
| -SqlInstance | string | Optional | $env:COMPUTERNAME | Target SQL Server instance. |
| -SqlCredential | PSCredential | Optional | — | Credentials for the connection. |
| -OutputPath | string | Optional | — | Optional CSV export path. |
| -EnableException | switch | Optional | $false | Re-throw exceptions instead of returning $null. |
Output
Returns a [PSCustomObject] with:
• SqlInstance — target instance
• Status — OK, Warning, or Info
• FileCount — current number of TempDB files
• RecommendedCount — ideal file count
• FileSizesMB — array of current file sizes
• GrowthMB — array of autogrow values
• Paths — array of file paths
• Recommendations — combined message string
Examples
Check local instance TempDB configuration
Get-sqmTempDbRecommendation -SqlInstance "SQL01"
Check TempDB and export results to CSV
Get-sqmTempDbRecommendation -SqlInstance "SQL01" -OutputPath "D:\Reports\tempdb-rec.csv"