dbatools is a free PowerShell module with over 300 SQL Server administration, best practice and migration commands included.

Please note that documentation and command names may be out of date while we work furiously towards 1.0


Removes (drops) database snapshots from the server




To remove all database snapshots from sqlserver2014a

Remove-DbaDbSnapshot -SqlServer sqlserver2014a -AllSnapshots

To remove database snapshots named HR_snap_20161201 and HR_snap_20161101

Remove-DbaDbSnapshot -SqlServer sqlserver2014a -Snapshots HR_snap_20161201, HR_snap_20161101

To remove all database snapshots having HR and Accounting as base dbs

Remove-DbaDbSnapshot -SqlServer sqlserver2014a -Databases HR, Accounting

To remove HR_snapshot and Accounting_snapshot

Remove-DbaDbSnapshot -SqlServer sqlserver2014a -Snapshots HR_snapshot, Accounting_snapshot

To remove all snapshots associated with databases that have dumpsterfire in the name

Get-DbaDbSnapshot -SqlServer sql2016 | Where SnapshotOf -like ‘*dumpsterfire*’ | Remove-DbaDbSnapshot


This command was created by Simone Bizzotto. You can find Simone on LinkedIn.


From PowerShell, execute Get-Help Remove-DbaDbSnapshot -Detailed for more information on this function.

Source Code

Want to see the source code? View Remove-DbaDbSnapshot.ps1 on GitHub

Related commands