It's very easy to take the backup, set the variables, of server name, db name and output path.
$server = “TWSQL1”
$database = “ConfigMgr”
$output = “C:\Users\Administrator\Desktop\SQL\ConfigMgr.bat”
Backup-SqlDatabase -ServerInstance $server -Database
$database -BackupFile $output
|