Allam Purushotham

Allam Purushotham

  • 460
  • 3.2k
  • 55k

how to disable a plugin in Dynamics CRM using PowerShell code

Mar 27 2024 7:21 AM

$plugins = Get-CrmPlugin -Connection $crmConnection


$pluginToDisable = $plugins | Where-Object { $_.Name -eq "AccountAsyncPlugin" }

# Check if the plugin was found
if ($pluginToDisable) {
    # Disable the plugin
    Disable-CrmPlugin -Connection $crmConnection -Id $pluginToDisable.Id
    Write-Host "Plugin 'MyPlugin' has been disabled."
} else {
    Write-Host "Plugin 'MyPlugin' not found."
}


Answers (2)