dbatools is a free PowerShell module with over 200 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


To get the same results use Invoke-DbaWhoIsActive then pipe the results to Out-GridView.

Invoke-DbaWhoIsActive

Outputs the results of Adam Machanic’s sp_WhoIsActive to a GridView (default) or DataTable. GridView is good for analysis while DataTable is ideal for uploading the output to SQL Server (Write-SqlWhoIsActive coming soon :))

If sp_WhoIsActive is not installed in the system, it will be downloaded and installed to a database you specify with either -Database or a database you select from Show-SqlDatabaseList.

This is v0.1 of Invoke-DbaWhoIsActive. Better GridView formatting options and auto-population (tab completion) soon.

newwhoisactive

What’s really amazing about GridViews is the ability to filter and sort with extreme ease.

newfilterwhoisactive

Examples

To execute sp_whoisactive on sqlserver2014a. This command expects sp_WhoIsActive to be in the master database. Logs into the SQL Server with Windows credentials.

 

To execute sp_whoisactive on sqlserver2014a. This command expects sp_WhoIsActive to be in the dbatools database, and logs into the SQL Server with SQL Authentication.

 

To run sp_WhoIsActive @filter_Type = ‘Database’, @filter = ‘SharePoint_Config’

 

To run sp_WhoIsActive @get_avg_time

 

To run sp_WhoIsActive @get_outer_command = 1, @find_block_leaders = 1 and output to a DataTable

 

Get-Help

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

Source Code

Want to see the source code? View Invoke-DbaWhoIsActive.ps1 on GitHub
 

Related commands