Performs a comprehensive best-practice audit of a SQL Server instance covering MAXDOP, Max Server Memory, Cost Threshold for Parallelism, xp_cmdshell, SA account, sysadmin count, CLR, SQL XPs, TempDB configuration, collation, and SQL Server version. Returns one result row per check with Status OK / Warning / Failed / Info / Error.
Execution Flow
Synopsis
Connects via dbatools and runs up to 11 best-practice checks (13 with -Detailed). Each check produces a [PSCustomObject] with a human-readable Message and a Status of OK, Warning, Failed, Info, or Error. The Max Server Memory check uses the same logic as Test-sqmMaxMemory (85%/90%/95% thresholds). MAXDOP recommendation scales with core count: up to 4 cores → core count; 5–8 → 4; 9–16 → 8; >16 → 16.
Requires dbatools. No file output — results are returned as objects only. Pipe to Format-Table or Out-GridView for quick review. Use -Detailed to add autogrow, backup directory, and per-database collation checks.
Check Summary
Check
Threshold / Recommendation
Status values
MAXDOP
2..min(cores,16); =0 → Warning; =1 → Failed
OK
/
Warning
/
Failed
Max Server Memory
85%–95% of physical RAM; default value (2147483647) → Warning