How do I completely turn off Windows Defender from PowerShell?
772
Set-MpPreference -DisableRealtimeMonitoring disables the first one, what are the specific switches to disable the others you see when you open the UI? I have not found a clear example of this in the docs and I don't feel like running EVERY disable switch because MS docs are bad.
I needed to disable Windows defender because I installed a software which I modified with orca (MSI modification), and defender kind of blocked it.
Found this "long" solution on this link. I tested it on Windows 10 version 21H2. It gives me then the following answer, which looks good.
Just make a new disableDefender.ps1 file and write the following code inside
After going for hours through the docs: https://docs.microsoft.com/en-us/powershell/module/defender/index?view=win10-ps
Just decided to uninstall it. This works on WS 2016 with PS 5.1.
The below didn't work for me (from a blog dated 2011-2012), but give it a try before you uninstall:
Later edit: Found a way for Windows 10, tested on 20H2 only. Please add a comment if it works for previous builds.
from windows server 2016 you could try
uninstall-windowsfeature -name windowsserverantimalware
For example you can use something like this - > Run PowerShell console as Administrator - > Paste to console and hit enter
Full list of options with description available at: https://docs.microsoft.com/en-us/powershell/module/defender/set-mppreference?view=win10-ps
To disable Real-time Protection
Disable Automatic Sample Submission
Disable Cloud-Based Protection
I needed to disable Windows defender because I installed a software which I modified with orca (MSI modification), and defender kind of blocked it. Found this "long" solution on this link. I tested it on Windows 10 version 21H2. It gives me then the following answer, which looks good.
Just make a new
disableDefender.ps1
file and write the following code inside