Windows Server comes with its own virus scanner, Microsoft Defender Antivirus. It is switched on from the start, updates itself and checks every file that is opened or written. Most of the time you do not notice it. This guide shows how to check that it works, how to scan by hand, and how to exclude a folder when the scanner slows down a program that handles very many files.
The examples use Windows Server 2025. Run the commands in PowerShell as Administrator: right-click the Start button and choose Terminal (Admin).
1. Check That the Protection Is On
Get-MpComputerStatus | Format-List AntivirusEnabled, RealTimeProtectionEnabled, AntivirusSignatureLastUpdated, QuickScanEndTime
AntivirusEnabled : True RealTimeProtectionEnabled : True AntivirusSignatureLastUpdated : 12/1/2026 10:10:58 PM QuickScanEndTime : 12/2/2026 3:38:45 AM
- The first two lines must say True.
- AntivirusSignatureLastUpdated is the date of the list of known threats. It should not be older than a few days. Windows fetches it with its updates;
Update-MpSignaturefetches it now. - QuickScanEndTime is the end of the last quick scan.
2. Run a Scan
A quick scan checks the places where threats usually hide. On the example server it took about three and a half minutes:
Start-MpScan -ScanType QuickScan
To check one folder, for example after you received files from somebody else:
Start-MpScan -ScanType CustomScan -ScanPath "C:\Users\Administrator\Downloads"
Both commands print nothing when they are done. See what was found:
Get-MpThreatDetection
No answer means that nothing was found. Start-MpScan -ScanType FullScan checks every file on every disk; on large disks that takes hours and loads the server.
3. The Same in a Window
Open the Start menu, type Windows Security and open it. Choose Virus & threat protection. The page shows the result of the last scan (1). Quick scan (2) starts a scan, and Scan options (3) offers the full scan and the scan of one folder.
4. When Defender Scans by Itself
Get-MpPreference | Format-List ScanScheduleDay, ScanScheduleTime, ScanParameters
ScanScheduleDay : 0 ScanScheduleTime : 02:00:00 ScanParameters : 1
This is the setting of a server on which nobody changed it: every day (0) at 2:00 AM by the clock of the server, a quick scan (1). If your server is busiest at that hour, move the scan:
Set-MpPreference -ScanScheduleTime 04:00:00
5. Exclude a Folder
A program that reads or writes very many files, such as a game server or a database, can become slow because Defender checks each of these files. If you trust the program, tell Defender to leave its folder alone:
Add-MpPreference -ExclusionPath "D:\GameServer"
See the excluded folders, and remove one from the list again:
(Get-MpPreference).ExclusionPath Remove-MpPreference -ExclusionPath "D:\GameServer"
You can also exclude what one program opens, whatever folder it is in:
Add-MpPreference -ExclusionProcess "D:\GameServer\server.exe"
Defender no longer checks files there, also not harmful ones. Exclude only the folder of a program you trust and nothing more. Never exclude a whole disk, your Downloads folder or the Windows folder.
Good to Know
- Defender in Task Manager has a name that begins with Microsoft Defender Antimalware; in commands it is
MsMpEng. That it uses processor time and the disk during a scan is normal: Windows Server Is Slow? See What Uses the Processor, Memory, Disk and Network. - Do not switch the protection off to make the server faster. Move the scan or exclude one folder instead.
- The firewall is a different part of Windows: See Which Programs Listen on Your Windows Server and Which Ports Are Open.
- Keep Windows up to date: Windows Update on Windows Server.
