You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: defender-endpoint/command-line-arguments-microsoft-defender-antivirus.md
+18-11Lines changed: 18 additions & 11 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -8,7 +8,7 @@ ms.author: ewalsh
8
8
ms.custom: nextgen
9
9
ms.reviewer: ksarens
10
10
manager: deniseb
11
-
ms.date: 01/15/2025
11
+
ms.date: 01/16/2025
12
12
ms.subservice: ngp
13
13
ms.topic: how-to
14
14
ms.collection:
@@ -32,7 +32,7 @@ search.appverid: met150
32
32
You can perform various functions in Microsoft Defender Antivirus using the dedicated command-line tool **mpcmdrun.exe**. This utility is useful when you want to automate Microsoft Defender Antivirus tasks. You can find the utility in `%ProgramFiles%\Windows Defender\MpCmdRun.exe`. Run it from a command prompt.
33
33
34
34
> [!TIP]
35
-
> You might need to open an administrator-level version of the command prompt. When you search for **Command Prompt** on the Start menu, choose **Run as administrator**. If you're running an updated Microsoft Defender antimalware platform version, run `MpCmdRun` from the following location: `C:\ProgramData\Microsoft\Windows Defender\Platform\<antimalware platform version>`. For more information about the antimalware platform, see [Microsoft Defender Antivirus updates and baselines](microsoft-defender-antivirus-updates.md).
35
+
> You might need to open an administrator-level version of the command prompt. When you search for **Command Prompt** on the **Start** menu, choose **Run as administrator**. If you're running an updated Microsoft Defender antimalware platform version, run `MpCmdRun` from the following location: `C:\ProgramData\Microsoft\Windows Defender\Platform\<antimalware platform version>`. For more information about the antimalware platform, see [Microsoft Defender Antivirus updates and baselines](microsoft-defender-antivirus-updates.md).
36
36
37
37
The MpCmdRun utility uses the following syntax:
38
38
@@ -52,29 +52,36 @@ In our example, the MpCmdRun utility starts a full antivirus scan on the device.
52
52
53
53
|Command|Description|
54
54
|---|---|
55
-
|`-?`**or**`-h`|Displays all available options for the MpCmdRun tool|
55
+
|`-?`**or**`-h`|Displays all available options for the MpCmdRun tool.|
56
56
|`-Scan [-ScanType [<value>]] [-File <path> [-DisableRemediation] [-BootSectorScan] [-CpuThrottling]] [-Timeout <days>] [-Cancel]`|Scans for malicious software. Values for **ScanType** are:<p>**0** Default, according to your configuration<p>**1** Quick scan<p>**2** Full scan<p>**3** File and directory custom scan.<p>CpuThrottling runs according to policy configurations.|
|`-CaptureNetworkTrace -Path <path>`|Captures all the network input into the Network Protection service and saves it to a file at `<path>`. <br/>Supply an empty path to stop tracing.|
59
59
|`-GetFiles [-SupportLogLocation <path>]`|Collects support information. See [collecting diagnostic data](collect-diagnostic-data.md).|
60
60
|`-GetFilesDiagTrack`|Same as `-GetFiles`, but outputs to temporary DiagTrack folder.|
61
61
|`-RemoveDefinitions [-All]`|Restores the installed security intelligence to a previous backup copy or to the original default set.|
62
62
|`-RemoveDefinitions [-DynamicSignatures]`|Removes only the dynamically downloaded security intelligence.|
63
63
|`-RemoveDefinitions [-Engine]`|Restores the previous installed engine.|
64
-
|`-SignatureUpdate [-UNC \|-MMPC]`|Checks for new security intelligence updates.|
|`-CheckExclusion -path <path>`|Checks whether a path is excluded.|
70
+
|`-TDT [-on|-off|-default]`|Disable or Enable TDT feature or sets it to default. If no option is specified, it retrieves the current status.|
71
+
|`-OSCA`|Prints OS Copy Acceleration feature status.|
72
+
|`-DeviceControl -TestPolicyXml <FilePath> [-Rules | -Groups]`|Validate xml policy groups and rules.|
73
+
|`-TrustCheck -File <FilePath>`|Checks trust status of a file.|
70
74
|`-ValidateMapsConnection`|Verifies that your network can communicate with the Microsoft Defender Antivirus cloud service. This command will only work on Windows 10, version 1703 or higher.|
75
+
|`-ListCustomASR`|List the custom Azure Site Recovery rules present on this device.|
76
+
|`-DisplayECSConnection`|Displays URLs that Defender Core service uses to establish connection to ECS.|
77
+
|`-HeapSnapshotConfig <-Enable|-Disable> [-Pid <ProcessID>]`|Enable or Disable heap snapshot (tracing) configuration for process. Replace `<ProcessID>` with the actual process ID.|
71
78
|`-ResetPlatform`| Reset platform binaries back to `%ProgramFiles%\Windows Defender`.|
72
79
|`-RevertPlatform`| Revert platform binaries back to the previously installed version of the Defender platform.|
73
80
74
81
> [!NOTE]
75
-
> For the "Scan" command, the following are the default timeout values for Quick or Full scans where the scan will stop at that time by default.
76
-
- Scheduled Full Scans or MpCmdRun -scan: 7 day limit
77
-
- Scheduled Quick Scans or MpCmdRun -scan: 1 day limit
82
+
> For the `Scan` command, the following are the default time out values for Quick or Full scans where the scan will stop at that time by default.
83
+
> - Scheduled Full Scans or MpCmdRun -scan: Seven day limit
84
+
> - Scheduled Quick Scans or MpCmdRun -scan: One day limit
78
85
79
86
80
87
## Common errors in running commands via mpcmdrun.exe
@@ -83,7 +90,7 @@ The following table lists common errors that can occur while using the MpCmdRun
83
90
84
91
|Error message|Possible reason|
85
92
|---|---|
86
-
|**ValidateMapsConnection failed (800106BA)** or **0x800106BA**|The Microsoft Defender Antivirus service is disabled. Enable the service and try again. If you need help re-enabling Microsoft Defender Antivirus, see [Reinstall/enable Microsoft Defender Antivirus on your endpoints](switch-to-mde-phase-2.md#step-1-reinstallenable-microsoft-defender-antivirus-on-your-endpoints).<p> Note that in Windows 10 1909 or older, and Windows Server 2019 or older, the service was formerly called *Windows Defender Antivirus*.|
93
+
|**ValidateMapsConnection failed (800106BA)** or **0x800106BA**|The Microsoft Defender Antivirus service is disabled. Enable the service and try again. If you need help re-enabling Microsoft Defender Antivirus, see [Reinstall/enable Microsoft Defender Antivirus on your endpoints](switch-to-mde-phase-2.md#step-1-reinstallenable-microsoft-defender-antivirus-on-your-endpoints).<p> In Windows 10 1909 or older, and Windows Server 2019 or older, the service was formerly called *Windows Defender Antivirus*.|
87
94
|**0x80070667**|You're running the `-ValidateMapsConnection` command from a computer that is Windows 10 version 1607 or older, or Windows Server 2016 or older. Run the command from a machine that is Windows 10 version 1703 or newer, or Windows Server 2019 or newer.|
88
95
|**MpCmdRun is not recognized as an internal or external command, operable program, or batch file.**|The tool must be run from either `%ProgramFiles%\Windows Defender` or `C:\ProgramData\Microsoft\Windows Defender\Platform\4.18.2012.4-0` (where `2012.4-0` might differ since platform updates are monthly except for March)|
89
96
|**ValidateMapsConnection failed to establish a connection to MAPS (hr=80070005 httpcode=450)**|The command was attempted using insufficient privileges. Use the command prompt (cmd.exe) as an administrator.|
@@ -98,7 +105,7 @@ The following table lists common errors that can occur while using the MpCmdRun
98
105
-[Performance analyzer for Microsoft Defender Antivirus](tune-performance-defender-antivirus.md)
99
106
-[Configure Microsoft Defender Antivirus features](configure-microsoft-defender-antivirus-features.md)
100
107
-[Configure and validate Microsoft Defender Antivirus network connections](configure-network-connections-microsoft-defender-antivirus.md)
101
-
-[Reference topics for management and configuration tools](configuration-management-reference-microsoft-defender-antivirus.md)
108
+
-[Reference articles for management and configuration tools](configuration-management-reference-microsoft-defender-antivirus.md)
102
109
-[Microsoft Defender for Endpoint on Mac](microsoft-defender-endpoint-mac.md)
103
110
-[macOS Antivirus policy settings for Microsoft Defender Antivirus for Intune](/mem/intune/protect/antivirus-microsoft-defender-settings-macos)
104
111
-[Microsoft Defender for Endpoint on Linux](microsoft-defender-endpoint-linux.md)
0 commit comments