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


Get-DbaDatabaseSnapshot

Retrieves the list of database snapshot available, along with their base (the db they are the snapshot of), Size in MB, creation time and other details.

Screenshots

Examples

To return a custom object displaying Server, Database, DatabaseCreated, SnapshotOf, SizeMB, DatabaseCreated, IsReadCommittedSnapshotOn, SnapshotIsolationState

Get-DbaDatabaseSnapshot -SqlServer sqlserver2014a

To return information for database snapshots having HR and Accounting as base dbs

Get-DbaDatabaseSnapshot -SqlServer sqlserver2014a -Databases HR, Accounting

To return information for database snapshots HR_snapshot and Accounting_snapshot

Get-DbaDatabaseSnapshot -SqlServer sqlserver2014a -Snapshots HR_snapshot, Accounting_snapshot

Author

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

From PowerShell, execute   Get-Help Get-DbaDatabaseSnapshot -Detailed   for more information on this function. Want to see the source code? See it on GitHub