Skip to main content

An easy way to Exclude OFF-Line SQL databases from backup without starting SQL Server Management Studio

  • March 13, 2026
  • 3 comments
  • 34 views

After switching from TSM to Veeam, I found myself wasting plenty of hours excluding OFF-Line sql databases from backup.
Normally it demands that you start SQL Server Management Studio ( witch takes a war ), identify the correct instance and then exclude the ofline databases in each backup job…..

However… I’m notorisly lazy and in a bright moment, I turned to Powershell.

The resulth is a script telling me if a database is offline and therefore maybe should be excluded or if a database in online and can be included in backup, and best of all… without starting SQL Server Management Studio.
 
The script is eacy to use, gives a nice overview, you can in / exclude a database on a server in less than 20 sec ( depends on how many instances / databases the script have to scan ), you can chose to exclude Logs and diff backup and only have FULL backup if needed, and at last, - it logs every change make by time and username.

Script is free to use…

regards   MACH0NE


 

3 comments

Chris.Childerhose
Forum|alt.badge.img+21

Thanks for sharing the script with the community.  Things like this help others.  👍


coolsport00
Forum|alt.badge.img+21
  • Veeam Legend
  • March 13, 2026

Hi ​@MACH0NE - Welcome to the Community!

Hey...nice “little” script . Really appreciate you sharing this here on the Hub. It will no doubt help those in the Community who have a similar experience.


kciolek
Forum|alt.badge.img+1
  • Influencer
  • March 13, 2026

thanks for sharing! I’ll add this to my repo of scripts I’ll probably never use but have helped a customer from time to time.