How to disable virus and threat protection in Windows Server?

In earlier versions of Windows Server, antivirus settings were only accessible via PowerShell. Now, you can also manage them through the graphical interface: Windows Settings → Windows Security → Virus & threat protection.

If you prefer the command line, open PowerShell as Administrator and run:

Set-MpPreference -DisableRealtimeMonitoring $true.

To re-enable virus and threat protection, run:

Set-MpPreference -DisableRealtimeMonitoring $false.

Both methods—GUI and command line—are fully functional.

Updated Date 29.12.2025
We use cookies and web analytics services to ensure the proper functioning of the website, analyze web-site traffic, and improve the quality of our services.
By continuing to use the website, you consent to the Privacy Policy and consent to the processing of cookie files and technical data.