Regenerate the Windows 11 Search package data for the affected profile first; Microsoft documents this procedure specifically for cases where Search works in a newly created account but fails in the original account.^1^
Regenerate Search for the affected account
This procedure deletes a profile-specific package folder and registry key. Back up the registry and important files first; deleting the wrong registry key can damage the profile.
- Sign in to the working account you created. Ensure that account is an administrator.
- In File Explorer, delete this folder from the affected profile, replacing
<AffectedUser> with its folder name:
C:\Users\<AffectedUser>\AppData\Local\Packages\MicrosoftWindows.Client.CBS_cw5n1h2txyewy
AppData is hidden by default. Enter the complete path directly in File Explorer’s address bar rather than enabling protected operating-system files.
- Sign out of the working account and sign back into the affected account.
- Press Windows+R, enter
regedit, and select OK.
- In Registry Editor:
- Open an elevated PowerShell window without using Search:
- Press Ctrl+Shift+Esc to open Task Manager.
- Select Run new task.
- Enter
powershell.
- Select Create this task with administrative privileges, then select OK.
- Re-register the Windows 11 Search package:
Add-AppxPackage `
-Path "C:\Windows\SystemApps\MicrosoftWindows.Client.CBS_cw5n1h2txyewy\Appxmanifest.xml" `
-DisableDevelopmentMode `
-Register
- Restart the computer and test Search from the affected account. Windows should regenerate the deleted package folder and registry key and restart search indexing.^1^
If the Microsoft sign-in window still closes
If Search is restored but Microsoft account sign-in still fails only in the original account, move to the working profile rather than repeatedly attempting the same sign-in. Microsoft’s corrupted-profile procedure is to make the new account an administrator, copy personal data from the old profile, restart, and then use the new profile.^2^
- Sign in to the new administrator account.
- Open:
-
C:\Users\<OldUsername>
-
C:\Users\<NewUsername>
- Copy personal files and folders from the old profile into the corresponding locations in the new profile.
- Do not enable hidden or protected operating-system files and do not copy the entire old profile wholesale. That can carry damaged profile-specific data into the new account.
- Restart and sign in to the new account.
- If the new account is currently local, change it to a Microsoft account after confirming that Search and the Microsoft sign-in window work.
- Reconfigure affected applications and sign back into Microsoft Store apps as needed; locally stored email may need to be imported separately.^2^
Keep the old account until all documents, browser data, application data, and locally stored email have been transferred and verified.
References
- Fix problems in Windows Search
- Fix a corrupted user profile