> For the complete documentation index, see [llms.txt](https://rfc1918.gitbook.io/offsec/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://rfc1918.gitbook.io/offsec/defence-evasion/microsoft-defender.md).

# Microsoft Defender

## Display a list of cmdlets contained in the Defender module

```powershell
Get-Command -Module Defender
```

```powershell
> Get-Command -Module Defender

CommandType     Name                                               Version    Source
-----------     ----                                               -------    ------
Function        Add-MpPreference                                   1.0        Defender
Function        Get-MpComputerStatus                               1.0        Defender
Function        Get-MpPreference                                   1.0        Defender
Function        Get-MpThreat                                       1.0        Defender
Function        Get-MpThreatCatalog                                1.0        Defender
Function        Get-MpThreatDetection                              1.0        Defender
Function        Remove-MpPreference                                1.0        Defender
Function        Remove-MpThreat                                    1.0        Defender
Function        Set-MpPreference                                   1.0        Defender
Function        Start-MpRollback                                   1.0        Defender
Function        Start-MpScan                                       1.0        Defender
Function        Start-MpWDOScan                                    1.0        Defender
Function        Update-MpSignature                                 1.0        Defender
```

## Check for running Microsoft Defender services <a href="#geom_inter_1652257084183_23_15" id="geom_inter_1652257084183_23_15"></a>

```powershell
Get-Service SecurityHealthService, WinDefend, Sense, WdNisSvc | Select-Object Name,DisplayName,Status
```

`Get-MpComputerStatus` allows you to display the current status of Windows Defender: enabled options, virus definition date and version, last scan time, and others.

![](/files/rj2eJ6PEw37CD6GYL6UB)

To quickly check if Windows Defender is running on your computer and find out the last antivirus definition update date, run the following PowerShell command:

```powershell
Get-MpComputerStatus | Select-Object -Property Antivirusenabled,AMServiceEnabled,AntispywareEnabled,BehaviorMonitorEnabled,IoavProtectionEnabled,NISEnabled,OnAccessProtectionEnabled,RealTimeProtectionEnabled,AntivirusSignatureLastUpdated
```

## Disable Realtime monitoring altogether

```powershell
Set-MpPreference -DisableRealtimeMonitoring $true
```

## References

{% embed url="<https://theitbros.com/managing-windows-defender-using-powershell>" %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://rfc1918.gitbook.io/offsec/defence-evasion/microsoft-defender.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
