SOLVED

Issue with Windows Defender on Windows 11

Brass Contributor

I cannot open any of the settings on windows defender, when i try to it tells me to look for a compatible app in the Microsoft Store. Is this a bug or some other (fixable) issue?

444 Replies

@fggIB 

Ive tried that but Im getting an error message. are there any other options to fix this?

PS C:\WINDOWS\system32> Get-AppxPackage Microsoft.SecHealthUI -AllUsers | Reset-AppxPackage
>>
Get-AppxPackage : Access is denied.
Access is denied.
At line:1 char:1
+ Get-AppxPackage Microsoft.SecHealthUI -AllUsers | Reset-AppxPackage
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [Get-AppxPackage], UnauthorizedAccessException
+ FullyQualifiedErrorId : System.UnauthorizedAccessException,Microsoft.Windows.Appx.PackageManager.Commands.GetApp
xPackageCommand

That worked for me thankyou very much I was getting so frustrated that defender wouldn't open and I kept getting the you'll need an ap for that msg
Works like it should now. Thanks!

@wincenty make sure you are running powershell as admin

It Does work on Windows 11. you just have to make sure to run PowerShell as admin.

I did run it as an admin on powershell (I pasted the command and the message I was getting in my comment above). The message I got is that the access is restricted. So this didn't solve the issue. 

Id be grateful if you had any other ideas how to fix this... 

@AxEngine 

Access should not be restricted if running it as admin, unless there is some sort of group policy set. I do not have any other suggestions.

@DLDADRIZZLE It worked for me too! thankyou very much :)

Thanks, this fixed it for me
SO TRUE

Just got a new Laptop, had this issue.

using "Get-AppxPackage Microsoft.SecHealthUI -AllUsers | Reset-AppxPackage" fixed it.

 

note, you need to use elevated (run as admin) "powershell" not elevated "command prompt" for the string to work.

Thank you everyone who has posted the powershell prompt fix. I can't believe I keep having to go to online forums to fix issues with windows every few months. I'm seriously considering switching to mac for my next computer because I'm so sick of dealing with the constant issues that we have to figure out ourselves

I have tried this fix on 6 different PC's. In each case the first user on the system has full access to Windows Security. A second user on the system even if they are change to be an administrator is not able to access Windows Securty.
Its even weirder in my case - Im the only user, I run the powershell as admin and still I get the error message. hopeless.
Why cant Microsoft fix it globally? Its ridiculous.
This worked thank you.

@wincentyI haven't solved this problem, too. I tried a new clean local user account too, but still Windows defender doesn't work...

This was the only one that worked for for my Windows 21H2 (OS Build 22000.593). The key was running the command as the logged on user and not as administrator.

I doubt I can say thank you enough. I read through all posts running each new command suggested to no avail - but I had hope it would eventually be solved.

Thank you again.

 

UPDATE: For those that go right to the end of a long post, here's a recap of Rebecca Harshbarger's  post.

 

Note: This is for those that do not run their computers with an account with admin privileges.  In other words, if you need to enter both a username and a password when prompted for credentials if running commands as administrator, then this is for you.

 

First: run the command below via an elevated PowerShell:

 

 

 

 

PS C:\WINDOWS\system32> Set-ExecutionPolicy Unrestricted

PS C:\WINDOWS\system32> Get-AppxPackage Microsoft.SecHealthUI -AllUsers


Name                   : Microsoft.SecHealthUI
Publisher              : CN=Microsoft Corporation, O=Microsoft Corporation, L=Redmond, S=Washington, C=US
Architecture           : X64
ResourceId             : 
Version                : 1000.22581.1.0
PackageFullName        : Microsoft.SecHealthUI_1000.22581.1.0_x64__8wekyb3d8bbwe
InstallLocation        : C:\Program Files\WindowsApps\Microsoft.SecHealthUI_1000.22581.1.0_x64__8wekyb3d8bbwe
IsFramework            : False
PackageFamilyName      : Microsoft.SecHealthUI_8wekyb3d8bbwe
PublisherId            : 8wekyb3d8bbwe
PackageUserInformation : {S-1-5-21-3853775740-655389605-3070002155-1005 [admin]: Installed}
IsResourcePackage      : False
IsBundle               : False
IsDevelopmentMode      : False
NonRemovable           : True
Dependencies           : {Microsoft.VCLibs.140.00_14.0.30704.0_x64__8wekyb3d8bbwe, Microsoft.UI.Xaml.2.4_2.42007.9001.0_x64__8wekyb3d8bbwe}
IsPartiallyStaged      : False
SignatureKind          : Store
Status                 : Ok

 

 

NOTE:  If the PackageUserInformation doesn't list your username, then you'll need to continue to the next step below.  If your account is listed and you are stil unable to launch the Windows Security dialog, then you'll have to wait for another solution.

 

Copy the InstallLocation of the SecHealthUI executable - for me this is:

...
C:\Program Files\WindowsApps\Microsoft.SecHealthUI_1000.22581.1.0_x64__8wekyb3d8bbwe
...

 

Next: Launch another PowerShell window WITHOUT electing to run as administrator, then execute the following commands:

 

 

add-appxpackage -disabledevelopmentmode -register ('C:\Program Files\WindowsApps\Microsoft.SecHealthUI_1000.22581.1.0_x64__8wekyb3d8bbwe\AppxManifest.xml')

 

 

Now back to the elevated PowerShell, run the following command:

Get-AppxPackage Microsoft.SecHealthUI -AllUsers

 

NOTE: Make sure that PackageUserInformation now lists your user account.

 

You should now be able to launch the Windows defender UI without that very annoying message.

 

Thank you, it works

I'm having the exact same issue, on two separate laptops, one running Windows 10 and the other with Windows 11, and yes, I too did full reinstallations on both machines.  I am able to access the firewall / defender by going to the old school "Control Panel" but it's a nuisance to have to do this frequently.  I'm having this issue with other areas under "Settings" as well.  Very frustrating.  @Asuka_Okami 

It works. Thank you so much! @Francis_Powell