Remove Defender Exclusion
Removes one or more Microsoft Defender Antivirus exclusions of the selected type. Use this to clean up folder, file, process or file extension exclusions that are no longer needed, for example when an application is uninstalled. Only exclusions that are actually configured are removed, so the brick can safely run more than once.
Parameters
Section titled “Parameters”Exclusion Type
Section titled “Exclusion Type”Required — Default: Path
Select the kind of exclusion you want to remove.\n• Path - a folder or file that is excluded from scanning\n• Process - a program whose file activity is excluded from scanning\n• Extension - a file extension that is excluded from scanning\n\nAll values entered below must be of the selected kind. Add one brick per kind if you need to remove more than one kind. Allowed values: Path, Process, Extension.
Exclusion Value
Section titled “Exclusion Value”Required
The exclusion values to remove. Add one entry for each value. A single entry may also hold a comma or semicolon separated list, so a list that is pasted in one go still works. Spaces around a value are ignored, and so are empty entries.\n\nExample for Path:\nC:\Program Files\MyApp\nC:\Temp\MyApp\MyFile.log\n\nExample for Process:\nMyApp.exe\nMyOtherApp.exe\n\nExample for Extension:\nlog\ntmp\n\nA value that is not currently excluded is reported in the log and, depending on the setting below, either skipped or treated as a failure.
Continue If Exclusion Is Not Found
Section titled “Continue If Exclusion Is Not Found”Optional — Default: True
Enable to continue without an error when an exclusion is not configured on the device. This is recommended, so an uninstall workflow still succeeds when the exclusion has already been removed.\n\nDisable to fail the step when one or more of the specified exclusions could not be found.
Continue If Defender Is Not Present
Section titled “Continue If Defender Is Not Present”Optional — Default: True
Enable to continue without an error when Microsoft Defender Antivirus is not available on the device, for example when it has been replaced by another antivirus product. This is recommended for workflows that run on a mixed set of devices.\n\nDisable to fail the step when Microsoft Defender Antivirus cannot be reached.
Details
Section titled “Details”- Category: System
- Brick ID:
Defender-Exclusion-Remove
{ "category": "system", "description": "Removes one or more Microsoft Defender Antivirus exclusions of the selected type. Use this to clean up folder, file, process or file extension exclusions that are no longer needed, for example when an application is uninstalled. Only exclusions that are actually configured are removed, so the brick can safely run more than once.", "developerVendor": "CapaSystems A/S", "displayName": null, "id": "Defender-Exclusion-Remove", "name": "Remove Defender Exclusion", "parameters": [ { "allowManualInput": false, "defaultValue": null, "defaultValueObject": { "id": "Path", "name": "Path" }, "description": "Select the kind of exclusion you want to remove.\\n• Path - a folder or file that is excluded from scanning\\n• Process - a program whose file activity is excluded from scanning\\n• Extension - a file extension that is excluded from scanning\\n\\nAll values entered below must be of the selected kind. Add one brick per kind if you need to remove more than one kind.", "id": "ExclusionType", "name": "Exclusion Type", "regExValidation": "", "required": true, "type": "ComboBox", "value": null, "values": [], "valuesObject": [ { "id": "Path", "name": "Path" }, { "id": "Process", "name": "Process" }, { "id": "Extension", "name": "Extension" } ] }, { "allowManualInput": true, "defaultValue": null, "defaultValueObject": { "id": "", "name": "" }, "description": "The exclusion values to remove. Add one entry for each value. A single entry may also hold a comma or semicolon separated list, so a list that is pasted in one go still works. Spaces around a value are ignored, and so are empty entries.\\n\\nExample for Path:\\nC:\\Program Files\\MyApp\\nC:\\Temp\\MyApp\\MyFile.log\\n\\nExample for Process:\\nMyApp.exe\\nMyOtherApp.exe\\n\\nExample for Extension:\\nlog\\ntmp\\n\\nA value that is not currently excluded is reported in the log and, depending on the setting below, either skipped or treated as a failure.", "id": "ExclusionValue", "name": "Exclusion Value", "regExValidation": "", "required": true, "type": "MultiSelectComboBox", "value": null, "values": [], "valuesObject": [] }, { "allowManualInput": false, "defaultValue": "True", "defaultValueObject": null, "description": "Enable to continue without an error when an exclusion is not configured on the device. This is recommended, so an uninstall workflow still succeeds when the exclusion has already been removed.\\n\\nDisable to fail the step when one or more of the specified exclusions could not be found.", "id": "ContinueIfNotFound", "name": "Continue If Exclusion Is Not Found", "regExValidation": "", "required": false, "type": "Boolean", "value": null, "values": [], "valuesObject": null }, { "allowManualInput": false, "defaultValue": "True", "defaultValueObject": null, "description": "Enable to continue without an error when Microsoft Defender Antivirus is not available on the device, for example when it has been replaced by another antivirus product. This is recommended for workflows that run on a mixed set of devices.\\n\\nDisable to fail the step when Microsoft Defender Antivirus cannot be reached.", "id": "ContinueIfDefenderNotPresent", "name": "Continue If Defender Is Not Present", "regExValidation": "", "required": false, "type": "Boolean", "value": null, "values": [], "valuesObject": null } ], "powershell": { "base64Encoded": true, "function": "ZnVuY3Rpb2..." }, "type": "powerbrick", "version": "2026.10.8.1"}