Skip to content

Instantly share code, notes, and snippets.

@MikeFal
Created February 18, 2016 19:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save MikeFal/9c4477d7e62cd27034d6 to your computer and use it in GitHub Desktop.
Save MikeFal/9c4477d7e62cd27034d6 to your computer and use it in GitHub Desktop.
$InstanceName = 'localhost'
$smo = new-object ('Microsoft.SqlServer.Management.Smo.Server') $InstanceName
if($smo.Configuration.DefaultBackupCompression.ConfigValue -eq 0){
$smo.Configuration.DefaultBackupCompression.ConfigValue = 1
$smo.Configuration.Alter()
}
$smo.Configuration.DefaultBackupCompression
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment