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


Get-DbaDbRecoveryModel

Get-DbaDbRecoveryModel displays the Recovery Model for all databases. This is the default, you can filter using -Database, -ExcludeDatabase, -RecoveryModel.

Screenshots

dbatools-Get-DbaDbRecoveryModel

Examples

Gets all databases on SQL Server instance sql2014 having RecoveryModel set to BulkLogged

Get-DbaDbRecoveryModel -SqlInstance sql2014 -RecoveryModel BulkLogged -Verbose

Gets recovery model information for TestDB. If TestDB does not exist on the instance we don’t return anything.

Get-DbaDbRecoveryModel -SqlInstance sql2014 -Database TestDB

Author

This command was created by Viorel Ciucu. You can find Viorel on Twitter and his blog.

Get-Help

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

Source Code

Want to see the source code? View Get-DbaDbRecoveryModel.ps1 on GitHub
 

Related commands