Skip to content

Instantly share code, notes, and snippets.

@jrwarwick
Created April 19, 2018 05:13
Show Gist options
  • Save jrwarwick/98e9b61d25e2b075af69b59ddb4c0143 to your computer and use it in GitHub Desktop.
Save jrwarwick/98e9b61d25e2b075af69b59ddb4c0143 to your computer and use it in GitHub Desktop.
Basic MSSQL Backup
#!PowerShell
# Simple, basic localmachine MSSQL DB backup with no outage.
Start-Transcript -Path .\backup\MSSQL_Backup.log
get-date
write-output $env:COMPUTERNAME
Get-SqlDatabase -ServerInstance localhost |
Where { $_.Name -ne 'tempdb' } |
Backup-SqlDatabase -Verbose -BackupContainer .\backup\db\
Stop-Transcript
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment