On a Windows 10 machine, I have been trying to set the time of virus scans using the following PowerShell commands.
Set-MpPreference -ScanParameters FullScan
Set-MpPreference -ScanScheduleDay Monday
Set-MpPreference -ScanScheduleTime (Get-Date 20:00)
Set-MpPreference -ScanOnlyIfIdleEnabled 0
Set-MpPreference -ScanScheduleQuickScanTime (Get-Date 10:00)
However, Windows Defender doesn't seem to obey any of my instructions. Looking on the Event Viewer > Applications and Services Logs > Microsoft > Windows > Windows Defender > Operational, I see that Windows has been doing quick scans, but not at the time I specified. Sometimes later, sometimes earlier. Also it has not done a single full scan since I ran this script.
What's more, after running this script, it seems that my "Windows Defender Scheduled Scan" task in Task Scheduler was deleted. I expected that the Mp-Preference
code would modify this scheduled scan task, not delete it.
Has anyone else found that Set-MpPreference
also doesn't work for them? Or can anyone confirm that it does work for them? If so, did you have to do anything to make it work? Thanks.