Skip to content

Instantly share code, notes, and snippets.

@Kevin-Bronsdijk
Created July 11, 2016 02:18
Show Gist options
  • Save Kevin-Bronsdijk/80717ea970aba5c957a09844d1a9495e to your computer and use it in GitHub Desktop.
Save Kevin-Bronsdijk/80717ea970aba5c957a09844d1a9495e to your computer and use it in GitHub Desktop.
SQL SERVER LIST AUTO-SHRINK ENABLED DATABASES
Import-Module SQLPS -DisableNameChecking
#replace your with your instance name
$instanceName = "server\instance";
$srv = New-Object -TypeName Microsoft.SqlServer.Management.Smo.Server -ArgumentList $instanceName;
$srv.Databases | Where { $_.AutoShrink -eq 'True'}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment