Author | Chrissy LeMaire (@cl), netnerds.net |
Availability | Windows, Linux, macOS |
Want to see the source code for this command? Check out Stop-DbaExternalProcess on GitHub.
Want to see the Bill Of Health for this command? Check out Stop-DbaExternalProcess.
Stops an OS process created by SQL Server
Stops an OS process created by SQL Server
Helps when killing hung sessions with External Wait Types
Stop-DbaExternalProcess
[-ComputerName] <DbaInstanceParameter>
[[-Credential] <PSCredential>]
[[-ProcessId] <Int32>]
[-EnableException]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
PS C:\> Get-DbaExternalProcess -ComputerName SQL01 | Stop-DbaExternalProcess
Kills all OS processes created by SQL Server on SQL01
PS C:\> Get-DbaExternalProcess -ComputerName SQL01 | Where-Object Name -eq "cmd.exe" | Stop-DbaExternalProcess
Kills all cmd.exe processes created by SQL Server on SQL01
The target SQL Server host computer
Alias | |
Required | True |
Pipeline | true (ByPropertyName) |
Default Value |
Allows you to login to $ComputerName using alternative credentials.
Alias | |
Required | False |
Pipeline | true (ByPropertyName) |
Default Value |
The process ID of the OS process to kill
Alias | pid |
Required | False |
Pipeline | true (ByPropertyName) |
Default Value | 0 |
By default, when something goes wrong we try to catch it, interpret it and give you a friendly warning message.
This avoids overwhelming you with "sea of red" exceptions, but is inconvenient because it basically disables advanced scripting.
Using this switch turns this "nice by default" feature off and enables you to catch exceptions with your own try/catch.
Alias | |
Required | False |
Pipeline | false |
Default Value | False |
Shows what would happen if the command were to run. No actions are actually performed.
Alias | wi |
Required | False |
Pipeline | false |
Default Value |
Prompts you for confirmation before executing any changing operations within the command.
Alias | cf |
Required | False |
Pipeline | false |
Default Value |