Exclude Defender Antivirus Folder Scanning On Windows Nano Server 2016

In this article, I’ll show you how I exclude a folder from being scanned by Windows Defender Antivirus on Windows Nano Server 2016.

With the release of Windows Server 2016, Microsoft has made Windows Defender available for free on all Windows Server 2016 editions Including Nano.

By default, Defender Is not Installed on Windows Nano Server 2016, If you need to Install please use the following article Install Windows Defender AntiVirus On Windows Nano Server 2016

To get started, Log In to Nano Server using remote PowerShell or PowerShell Direct.

In my case, I’ll exclude my Virtual Machines folder located in C:\VMs and I’ll use the cmdlet set-mpPreference:

get-help Set-MpPreference

To exclude C:\VMs I’ll use the cmdlets below:

Add-MpPreference -ExclusionPath C:\VMs\ -Verbose

To confirm and review I’ll use


To remove exclusion use

Remove-MpPreference -ExclusionPath C:\VMs\