LLI Wiki — My Digital Knowledge Base

Windows: re-enable Defender and Windows Update blocked by policy

Registry keys and commands to re-enable Windows Defender, update its signatures and bypass WSUS.

When Windows Defender is turned off or Windows updates are blocked on a computer, the cause is often a policy (a GPO or a registry value under Policies). This memo gathers the commands to restore the situation. See also this article.

Re-enable Windows Defender

The policy "Turn off Windows Defender Antivirus" (state Enabled in the local Group Policy editor) writes the DisableAntiSpyware value under Defender's policy key:

HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows Defender

To re-enable Defender, delete the DisableAntiSpyware value (or the Windows Defender key under Policies), or set the policy back to "Not configured".

The local policy files, which may also hold these settings, are located here:

$MachineDir = "$env:windir\system32\GroupPolicy\Machine\registry.pol"
$UserDir = "$env:windir\system32\GroupPolicy\User\registry.pol"

Group Policy Editor: Turn off Windows Defender Antivirus set to Enabled

Update the signatures

cd %ProgramFiles%\Windows Defender
MpCmdRun.exe -removedefinitions -dynamicsignatures
MpCmdRun.exe -SignatureUpdate

The first command removes the downloaded dynamic signatures, the second one triggers a signature update.

Limit the CPU load of scans

Set-MpPreference -ScanAvgCPULoadFactor 25

Caps the average CPU load used by scheduled scans at 25%.

Re-enable online Windows Update (bypass WSUS)

If a policy forces the use of a WSUS server, the UseWUServer value of the following key controls it: 0 uses online Windows Update, 1 enables WSUS.

HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU

In PowerShell:

Set-ItemProperty -Path 'HKLM:\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU' -Name 'UseWUServer' -Value 0

Notes

Mastodon LLIMastodon SocialFosstodon