Skip to content

Instantly share code, notes, and snippets.


SQL PASS PowerShell Virtual Chapter sqlpsvc

View GitHub Profile
View Help get SQLPS Open Sourced and on GitHub.txt
sqlpsvc / Get-AutoCreateStatsInfo.ps1
Last active Mar 5, 2016
Basics - Monitor SQL Server database Auto Create Statistics
View Get-AutoCreateStatsInfo.ps1
# Code answers from Session Q & A (
$sqlservers = "sqlserver2014a","sql2012-esx"
foreach ($sqlserver in $sqlservers) {
Write-Output "Connecting to $sqlserver"
$server = New-Object Microsoft.SqlServer.Management.Smo.Server $sqlserver
foreach ($db in $server.databases) {
if ($db.AutoCreateStatisticsEnabled -eq $false) {