Notice: Function _load_textdomain_just_in_time was called incorrectly. Translation loading for the google-analytics-dashboard-for-wp domain was triggered too early. This is usually an indicator for some code in the plugin or theme running too early. Translations should be loaded at the init action or later. Please see Debugging in WordPress for more information. (This message was added in version 6.7.0.) in C:\inetpub\vhosts\gck.org.uk\httpdocs\c7solutions\wp-includes\functions.php on line 6114
Unable To Update Defender Preferences – Brian Reid – Microsoft 365 Subject Matter Expert

Unable To Update Defender Preferences


I was trying to add Microsoft Defender exceptions via PowerShell to a clients server (Windows Server 2016 if that matters) the other day and it was always failing – the error was:

PS> Add-MpPreference -ExclusionExtension .config
Add-MpPreference : Failed to modify preferences.
At line:1 char:1
+ Add-MpPreference -ExclusionExtension .config
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (MSFT_MpPreference:root\Microsoft\...FT_MpPreference) [Add-MpPreference],
   CimException
    + FullyQualifiedErrorId : HRESULT 0x8007007e,Add-MpPreference

This was returning “Failed to modify preferences” on the Add-MpPreference cmdlet and the error code 0x80070073

To fix I needed to uninstall Windows Defender and reboot and then reinstall it.

This was the following cmdlets, with the reboot indicated between them:

Uninstall-WindowsFeature -Name Windows-Defender
#Reboot here
Install-WindowsFeature -Name Windows-Defender
Install-WindowsFeature -Name Windows-Defender-GUI
#Reboot here (again)

Once this was done I was able to add Defender exceptions. The addition of exceptions also failed when done via the Defender Settings application as well (it asks you to authenticate and fails). This also worked after the uninstall/reinstall:


Posted

in

, , , ,

by

Tags:

Comments

3 responses to “Unable To Update Defender Preferences”

  1. priyanshu avatar
    priyanshu

    // pls help not working for me //
    Uninstall-WindowsFeature : The term ‘Uninstall-WindowsFeature’ is not recognized as the name of a cmdlet, function, script file, or
    operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.

    1. Sean avatar
      Sean

      Uninstall-WindowsFeature is for Windows Server only. For Windows Desktop use Disable-WindowsOptionalFeature and Enable-WindowsOptionalFeature.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.