Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $SQLServer = 'SHION\ALBEDO'
- $StatementTimeout = 0
- $DatabaseName = 'restoredemo_migration'
- $DatabaseBackup = "C:\temp\$DatabaseName.bak"
- ### Backup database. Changed to using SQL Connection object so I can control the timeout.
- $SQLServerConn = new-object ("Microsoft.SqlServer.Management.Smo.Server") $SQLServer
- $SQLServerConn.ConnectionContext.StatementTimeout = $StatementTimeout
- Backup-SqlDatabase -InputObject $SQLServerConn -Database $DatabaseName -BackupFile $DatabaseBackup
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement