Reputation: 108
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
Upvotes: 2
Views: 1407
Reputation: 2415
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 :)
Upvotes: 1