Question: Do you have a powershell script to backup SQL databases on a single SQL Server Instance , and direct them to a network share or a local drive? Also , I'd like an email notification with a screen output sent to my email box.

The purpose of the script is not to replace the current backup scripting but is for ad-hoc uses

Answer: There are plenty of different ways to manage the process of backing up SQL Server databases with Powershell.

In this script , the powershell cmdlet Invoke-sqlcmd is used to connect to a sql server , and execute some sql code to backup the user databases. Adjust the code according to your needs.

You'll need to configure some variables:

$target_backup_path - use either a local drive or network share.

$instance - an accessible SQL Server Instance , which allows access by whichever the current login is used to execute the script.