dbatools is not only intended to be a great migration tool, but also a toolset to help DBAs follow best practices. Check out all the new commands in this batch, courtesy of Mike Fal, Constantine Kokkinos and Chrissy LeMaire.



Best Practices Commands

Ever read a really great article about how to do something properly but then kinda forgot and you have to revisit each time? Well, we’ve codified some of those practices for you, making them easy to both follow and remember.

Commands that make your life easier

Get-DbaClusterActiveNode

Returns the active node(s) of a SQL Cluster

Returns the active node(s) of a SQL Cluster Get-DbaDbSpace

These commands, created by Mike Fal, get information about space available inside the database.

Install-SqlSpWhoIsActive and Update-SqlSpWhoIsActive

Install and update Adam Machanic’s sp_whoisactive with ease using these commands. The latest version of sp_whoisactive is automatically downloaded from Adam’s site and installed. Update-SqlSpWhoIsActive is actually an alias for Install-SqlSpWhoIsActive since Adam’s install routine handles updates.

Commands that are coming soon

And we’ve got more planned!

Copy-SqlMaintenancePlan

Maintenance plan support isn’t provided by dbatools at this time, but that’s soon going to change once this command is complete.

Maintenance plan support isn’t provided by dbatools at this time, but that’s soon going to change once this command is complete. Disable-DbaLogonTrigger

Like Reset-DbaAdmin, this is a command that won’t be used often, but when it is, its a lifesaver.

Find-DbaSqlInstance

This one’s gonna be fun. Scan your subnet, AD or specific servers for SQL Server instances.

Move-DbaDatabaseFile

We wanted to ensure this command is as fail-proof and useful as possible. It’s been tough getting progress bars to work, but we’re getting there! This command should be available in our next batch.

Restore-DbaBackupFromDirectory

Routine to restore databases from directories (think the way that Ola Hallengren’s outputs his by default)

Remove-DbaBackupFromDisk

Routine to remove SQL backups from disk. If you copy your backups to tape or use a third-party solution, this command will ensure that no backups are deleted until they’ve been marked as archived.

Test-DbaBackup

Routine to test your backups

Write-SqlSpWhoIsActive

Write the results of Show-SqlSpWhoIsActive to table!

Join us!

Some of these commands are in their infancy. Want to help make them better? Come join the coding party! We’re all hanging out on the SQL Server Community Slack in the #dbatools channel.