Show-sqmWhoIsActiveMonitor
Session ManagementsqmSQLTool v1.9.129+ · Show🔓 VIEW SERVER STATE
Get-sqmWhoIsActive: a WinForms dialog that shows the sessions in a grid which refreshes itself, instead of console output plus files at the end. Start begins a run, a timer fetches a snapshot on the configured interval and overwrites the grid with the newest one, so the grid always shows the current state rather than growing for hours. Stop (or closing the window while a run is active) ends the timer and writes exactly what Get-sqmWhoIsActive writes: a CSV with every iteration of the run, plus an HTML report containing only the last snapshot. Query and report logic are shared with Get-sqmWhoIsActive through the same private helpers (Get-sqmWhoIsActiveSnapshot / Export-sqmWhoIsActiveReport), so this dialog is purely an alternative view of identical data. It runs synchronously in the current runspace, no background jobs: each timer tick executes the DMV query on the UI thread, which is not noticeable in practice because the queries are light.Parameters
| Parameter | Type | Required | Default | Notes |
|---|---|---|---|---|
| -SqlInstance | string | Optional | $env:COMPUTERNAME | Pre-fills the instance field when the dialog opens. |
| -SqlCredential | PSCredential | Optional | , | Optional credential. Without it: Windows authentication. |
| -RepeatIntervalSeconds | int (1-3600) | Optional | 5 | Pre-fills the interval field. Can be changed in the dialog before starting a run. |
| -OutputPath | string | Optional | Get-sqmDefaultOutputPath\WhoIsActive | Directory for the CSV/HTML written on Stop. Same folder as Get-sqmWhoIsActive. |
Execution Flow
Examples
Open the live monitor for one instance
Show-sqmWhoIsActiveMonitor -SqlInstance "SQL01"
Start with a 2-second refresh interval
Show-sqmWhoIsActiveMonitor -SqlInstance "SQL01" -RepeatIntervalSeconds 2
Write the reports to a share instead of the default folder
Show-sqmWhoIsActiveMonitor -SqlInstance "SQL01" -OutputPath "\\fileserver\dba$\WhoIsActive"
Monitor a remote instance with SQL authentication
$cred = Get-Credential Show-sqmWhoIsActiveMonitor -SqlInstance "SQL01" -SqlCredential $cred