, , , , ,

How to disable and configure Windows Defender on Windows Server 2016 using PowerShell

Windows Defender PowerShell

Windows Server 2016 comes standard with built-in Anti-Malware called Windows Defender like Windows 10 Client. And per default, Windows Defender is active and has also turned on Real-Time Protection by default. In Windows Server 2016 Desktop Experience you can disable and configure Windows Defender using the UI or PowerShell, in the Windows Server 2016 Core version or on Nano Server you only have PowerShell available. Here are some quick command how you can configure or disable Windows Defender on Windows Server using PowerShell.

Check the Defender configuration and settings:


Get-MpPreference

Turn off Windows Defender Real-Time Protection using PowerShell


Set-MpPreference -DisableRealtimeMonitoring $true

Turn on Windows Defender Real-Time Protection using PowerShell


Set-MpPreference -DisableRealtimeMonitoring $false

Add a File path exclusion:


Set-MpPreference -ExclusionPath "C:\temp", "C:\VMs", "C:\NanoServer"

Add process exclusion


Set-MpPreference -ExclusionProcess "vmms.exe", "Vmwp.exe"

 

I hope this helps you to easily configure Windows Defender on Windows Server 2016. Btw. This also works on Defender on Windows 10.

12 responses

  1. Sushobhan Das Avatar
    Sushobhan Das

    “Set-MpPreference -DisableRealtimeMonitoring $true” does run but the Windows defender service still runs. Is there a way to stop the service?

  2. the only way Avatar
    the only way

    Remove-WindowsFeature Windows-Defender, Windows-Defender-GUI

  3. satish chander Avatar
    satish chander

    To remove windows defender open command prompt with administrator and copy following
    Dism /online /Disable-Feature /FeatureName:Windows-Defender /Remove /NoRestart /quiet

    restart server .

    thanks

  4. My Question Avatar
    My Question

    Satish – that works great!
    IS it possible to reinstall it using DISM?
    I might want to add it back later!

  5. Answered Avatar
    Answered

    IF needed, to reinstall it, mount the CD and add the feature back from Server Manager.
    If the source location is different, just edit the source location when asked.
    Example: wim:f:\sources\install.wim:4
    This probably could be used with DISM also, but didn’t try it.

  6. Dominik Avatar
    Dominik

    Thanks Satish, your tip worked like a charm!

  7. HERzzER Avatar
    HERzzER

    thanks, it works. the stupid defender could not be disabled using the GUI. the on/off switches that I turned off were always back enabled when closing and opening defender settings.

  8. JOATMON Avatar
    JOATMON

    Now I know Server 2016 Essentials is a dumbed down version of server, but I have a client that has 4 users and they need no more than Sever Essentials but why, in their wisdom, have Microsoft put Defender of all things into it? Anyway, thank you Satish, worked like a charm and no more errors in the Dashboard awaiting re-starts. :)

  9. jdptechnc Avatar
    jdptechnc

    If you remove the Windows Defender feature, you cannot view the WindowsUpdate.log file (using Get-WindowsUpdateLog cmdlet), there is some dependence on the Defender feature being installed to be able to the Windows Update log on Server 2016.

  10. Mustafa Avatar

    Thanks…. .

  11. Mark Kroehler Avatar
    Mark Kroehler

    Powershell (Uninstall-WindowsFeature -Name Windows-Defender-Features)

  12. Robin Avatar

    If you are running another AV….

    In Powershell running as admin type the below…

    Uninstall-WindowsFeature -Name Windows-Defender

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.