Skip to content

Instantly share code, notes, and snippets.

@mcsage
mcsage / FullDBBackup.ps1
Created February 5, 2021 13:00 — forked from AdamLJohnson/FullDBBackup.ps1
Powershell script to backup all SQL Databases on a server. Useful for SQL Express.
$serverName = ".\SQLExpress"
$backupDirectory = "D:\backupSQL"
$daysToStoreDailyBackups = 7
$daysToStoreWeeklyBackups = 28
$monthsToStoreMonthlyBackups = 3
[System.Reflection.Assembly]::LoadWithPartialName("Microsoft.SqlServer.SMO") | Out-Null
[System.Reflection.Assembly]::LoadWithPartialName("Microsoft.SqlServer.SmoExtended") | Out-Null
[System.Reflection.Assembly]::LoadWithPartialName("Microsoft.SqlServer.ConnectionInfo") | Out-Null
[System.Reflection.Assembly]::LoadWithPartialName("Microsoft.SqlServer.SmoEnum") | Out-Null
@mcsage
mcsage / keybase.md
Last active September 22, 2017 07:08

Keybase proof

I hereby claim:

  • I am mcsage on github.
  • I am sage (https://keybase.io/sage) on keybase.
  • I have a public key whose fingerprint is E1A4 1FFD 7C62 C556 AF6F 3062 9A92 C157 09E5 DC4D

To claim this, I am signing this object: