2 ms·
I have a shortcut on my desktop that toggles Real Time Protection: Create a file `toggle-defender-real-time-protection.ps1` in a known location with the follow
by Sujan 8y ago
I have a shortcut on my desktop that toggles Real Time Protection:
Create a file `toggle-defender-real-time-protection.ps1` in a known location with the following content:
$preferences = Get-MpPreference
Set-MpPreference -DisableRealtimeMonitoring (!$preferences.DisableRealtimeMonitoring)
Then create a shortcut for this target:
%SystemRoot%\system32\WindowsPowerShell\v1.0\powershell.exe -ExecutionPolicy Bypass -File "toggle-defender-real-time-protection.ps1"
Make it run as Administrator.
(Source of this nice script: https://superuser.com/a/1287788/25933 https://superuser.com/a/1287788/25933)
Note that Windows somehow turns the protection on after a random amount of time.