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-DbaLogShippingError

When your log shipping fails it’s sometimes hard to see why it fails.
Using this function you’ll be able to find out what went wrong in a short amount of time.

Screenshots

dbatools-Get-DbaLogShippingError

Examples

Get all the log shipping errors that occurred.

Get-DbaLogShippingError -SqlInstance sql1

Get the errors that have something to do with the backup of the databases.

Get-DbaLogShippingError -SqlInstance sql1 -Action Backup

Get the errors that occurred on the secondary instance.
This will return the copy of the restore actions because those only occur on the secondary instance.

Get-DbaLogShippingError -SqlInstance sql1 -Secondary

Get the errors that have occurred from “01/05/2018”. This can also be of format “yyyy-MM-dd”.

Get-DbaLogShippingError -SqlInstance sql1 -DateTimeFrom “01/05/2018”

Get the errors that have occurred between “01/05/2018” and “01/07/2018”.
See that is doesn’t matter how the date is represented.

Get-DbaLogShippingError -SqlInstance sql1 -Secondary -DateTimeFrom “01/05/2018” -DateTimeTo “2018-01-07”

Author

This command was created by Sander Stad. You can find Sander on Twitter and his blog.

Get-Help

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

Source Code

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

Related commands