Author | John McCall (@lowlydba), lowlydba.com |
Availability | Windows, Linux, macOS |
Want to see the source code for this command? Check out Remove-DbaRgWorkloadGroup on GitHub.
Want to see the Bill Of Health for this command? Check out Remove-DbaRgWorkloadGroup.
Removes workload groups from SQL Server Resource Governor
Removes specified workload groups from SQL Server Resource Governor and automatically reconfigures the Resource Governor so changes take effect immediately.
Workload groups define resource allocation policies for incoming requests, and removing them eliminates those resource controls.
Useful for cleaning up test environments, removing deprecated resource policies, or simplifying Resource Governor configurations during performance tuning.
Works with both internal and external resource pools, and can process multiple workload groups through pipeline input from Get-DbaRgWorkloadGroup.
Remove-DbaRgWorkloadGroup
[[-SqlInstance] <DbaInstanceParameter[]>]
[[-SqlCredential] <PSCredential>]
[[-WorkloadGroup] <String[]>]
[[-ResourcePool] <String>]
[[-ResourcePoolType] <String>]
[-SkipReconfigure]
[[-InputObject] <WorkloadGroup[]>]
[-EnableException]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
PS C:\> Remove-DbaRgResourcePool -SqlInstance sql2016 -WorkloadGroup "groupAdmin" -ResourcePool "poolAdmin" -ResourcePoolType Internal
Removes a workload group named "groupAdmin" in the "poolAdmin" resource pool for the instance sql2016
PS C:\> Remove-DbaRgResourcePool -SqlInstance sql2016 -WorkloadGroup "groupAdmin"
Removes a workload group named "groupAdmin" in the default resource pool for the instance sql2016.
The target SQL Server instance or instances.
Alias | |
Required | False |
Pipeline | true (ByValue, ByPropertyName) |
Default Value |
Credential object used to connect to the Windows server as a different user.
Alias | |
Required | False |
Pipeline | true (ByPropertyName) |
Default Value |
Specifies the name of the workload group(s) to remove from Resource Governor.
Use this when you need to eliminate specific resource allocation policies or clean up deprecated workload configurations.
Alias | |
Required | False |
Pipeline | false |
Default Value |
Specifies the resource pool containing the workload group to be removed. Defaults to "default" pool.
Required when workload groups exist in custom resource pools rather than the default SQL Server resource pool.
Alias | |
Required | False |
Pipeline | false |
Default Value | default |
Specifies whether to target Internal or External resource pools. Defaults to "Internal".
Use "External" when removing workload groups that manage external script execution resources like R or Python jobs.
Alias | |
Required | False |
Pipeline | false |
Default Value | Internal |
Accepted Values | Internal,External |
Skips the automatic Resource Governor reconfiguration that makes workload group changes take effect immediately.
Use this when removing multiple workload groups in sequence to avoid repeated reconfigurations, but remember to manually reconfigure afterwards.
Alias | |
Required | False |
Pipeline | false |
Default Value | False |
Accepts workload group objects piped from Get-DbaRgWorkloadGroup for removal.
Use this approach when you need to filter workload groups first or when processing multiple groups across different resource pools.
Alias | |
Required | False |
Pipeline | true (ByValue) |
Default Value |
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 |