Forum Discussion
Issue with Windows Defender on Windows 11
- Aug 07, 2021I had this problem on all machines updated from 19043.1151 to 22000.120.
This command from elevated PowerShell fixed the problem for me, try it and report the results:
Get-AppxPackage Microsoft.SecHealthUI -AllUsers | Reset-AppxPackage
Step 1. While logged into Windows as my regular user, I started PowerShell 7 (x64) in Administrator code and ran these two commands:
Set-ExecutionPolicy Unrestricted
Get-AppxPackage Microsoft.SecHealthUI -AllUsers
The second command showed a bunch of information, including the InstallLocation.
Step 2. I started PowerShell 7 (x64) in regular mode, so that it ran as my regular user. I entered a command like this, where InstallLocation was the value from Step 1, above:
add-appxpackage -disabledevelopmentmode -register ('InstallLocation\AppxManifest.xml')
This was the exact text of my command; yours may vary:
add-appxpackage -disabledevelopmentmode -register ('C:\Program Files\WindowsApps\Microsoft.SecHealthUI_1000.22000.1.0_neutral__8wekyb3d8bbwe\AppxManifest.xml')
That fixed the problem. By the way, once it was fixed, the command "Get-AppxPackage Microsoft.SecHealthUI -AllUsers" showed both my usernames in its PackageUserInformation value.
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.
- WHowoeApr 27, 2022Copper ContributorI don't know how to express my gratitude to you. I tried to solve this problem for about 10 days. And this is the only working solution for me. I will remember for a long time how "The man on the forum literally saved my life" haha. Thank you
- jdsteel7Apr 25, 2022Copper ContributorThis worked for me!! Thank you! The problem was that my admin account worked fine with the Get-AppxPackage Microsoft.SecHealthUI -AllUsers command but my other account was not working. Your instructions solved it perfectly. Much appreciated.
- François BretonApr 11, 2022Copper ContributorThis is the right answer for me. As describe, the key for me was running the command as the logged on user and not as administrator to disable the development mode.
- Jabber00Apr 11, 2022Copper Contributor
François Breton
Can you explain better what you mean with "as the logged on user and not as administrator to disable the development mode"?- François BretonApr 12, 2022Copper ContributorJabber00
I follow the solution wrote by ak2766 on avr. 06 2022 who made an update to the post of Rebecca Harshbarger.
First: run the command below via an elevated PowerShell and next I launch another PowerShell WITHOUT elevated permission, then I executed the commands to disable the development mode.
add-appxpackage -disabledevelopmentmode -register ('<THE PATH OF YOUR MANIFEST>\WindowsApps\Microsoft.SecHealthUI_1000.22581.1.0_x64__8wekyb3d8bbwe\AppxManifest.xml')
And after I run the Get-AppxPacakge WITH elevated permission.