2

I am trying to configure windows defender preferences through PowerShell as administrator. I am using the following commands:

Set-MpPreference -ScanScheduleDay 5
Set-MpPreference -ScanScheduleTime 03:57

However when checking the results with

Get-MpPreference

The settings have not changed even after restarting the pc. However checking the corresponding registry keys (regedit.exe) I find that the keys do change to the new values straight away:

Computer\HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows Defender\Scan

Are my commands actually changing the settings? Other setting that I can check in the “windows security” app, do work fine such as:

Set-MpPreference -DisableRealtimeMonitoring 1

Thanks for any help! enter image description here

Samuel
  • 53
  • 8

1 Answers1

1

Looking at the documentation for Set-MpPreference, it's a little confusing. For the -ScanScheduleDay parameter -> Accepted Values, it lists using the word for each day rather than a number. Try using::

-ScanScheduleDay Thursday

As for the -ScanScheduleTime parameter, it says using the number of minutes after midnight to perform the scan. I'm guessing you are wanting the scan to start at 3:57am in the morning so I would try using:

-ScanScheduleTime 237

Let me know how you get on :)

I.T Delinquent
  • 2,305
  • 2
  • 16
  • 33
  • Thanks. However, both using the word Thursday or integer 5 have the same effect of changing the registry key but not the result of Get-MpPreference. Have you tried on your pc? Did it work differently? – Samuel Jul 31 '19 at 09:32