When you cannot log out of a Work or School account in Windows 11, Windows keeps prompting you to sign in to an account you no longer use or need. This happens after leaving a company, finishing school, or switching devices between organizations. In some cases, the Disconnect button goes missing from Settings entirely, or Windows keeps displaying sign-in prompts even after you attempt to remove the account.

Before applying the fixes below, sign out of all Microsoft 365 apps including Outlook, Teams, and OneDrive, then restart your PC and try removing the account again. If the issue persists, work through the fixes in order.
Fix 1: Disconnect the Account from Access Work or School
This is the standard path. A Work or School account may appear under two separate sections in Settings: Access work or school and Your accounts. If you cannot find the Disconnect option under one section, check the other.
- Press Win + I to open Settings.
- Go to Accounts > Access work or school.
- Select the Work or School account you want to remove.
- Click Disconnect.
- Confirm when prompted.
- Restart your PC.
If the Disconnect button is missing or grayed out, move to the next fix.
Fix 2: Switch to a Local Account Temporarily
If the Work or School account is linked to your Microsoft account profile, Windows may block its removal. Switching to a local account temporarily breaks that connection and allows the disconnect to go through.
- Press Win + I to open Settings.
- Go to Accounts > Your info.
- Click Sign in with a local account instead.
- Follow the on-screen steps to create and switch to a local account.
- Go to Settings > Accounts > Access work or school.
- Select the Work or School account and click Disconnect.
- Restart your PC.
After the account is removed, go back to Settings > Accounts > Your info and click Sign in with a Microsoft account to switch back.
Fix 3: Use Microsoft’s WPJCleanUp Tool
If the account cannot be removed through Settings, your device may contain an outdated Workplace Join (WPJ) registration that is blocking the removal. Microsoft provides a dedicated utility called WPJCleanUp that removes these stale registrations automatically.
First, verify whether your device is Workplace Joined. Open an elevated Command Prompt and run:
dsregcmd /statusIf the output shows WorkplaceJoined : YES, proceed with WPJCleanUp.
- Download WPJCleanUp.zip from Microsoft’s support page on resetting Microsoft 365 activation state.
- Extract the ZIP file.
- Open the extracted folder, right-click WPJCleanUp.cmd, and select Run as administrator.
- Let the tool complete the cleanup process.
- Restart your PC.
- Go to Settings > Accounts > Access work or school and confirm the account is gone.
Fix 4: Disconnect the Device Using dsregcmd
If your device is registered with Microsoft Entra ID (Azure AD) or still shows an organization link, the dsregcmd /leave command removes that registration directly from the command line.
First, check your device’s registration status:
dsregcmd /statusLook for these fields in the output:
| Field | Value Meaning |
|---|---|
| AzureAdJoined | YES = device is Azure AD-joined |
| WorkplaceJoined | YES = device is workplace-registered |
| DomainJoined | YES = device is on-premise domain joined |
If AzureAdJoined : YES or EnterpriseJoined : YES appears, run the following in an elevated Command Prompt:
dsregcmd /leaveWait for the command to complete, then restart your PC.
Note: This command may affect access to organizational resources, single sign-on (SSO), and device management features. If you still use the device for work or school purposes, contact your IT administrator before running it.
Fix 5: Disconnect an Azure AD-Joined Device via Settings
If your device is fully Azure AD-joined, the Settings app shows a distinct entry for it under Access work or school. This requires a separate disconnect flow compared to a standard Work or School account.
- Press Win + I to open Settings.
- Go to Accounts > Access work or school.
- Click the entry labeled Connected to [Organization] Azure AD.
- Click Disconnect.
- Enter your local Windows account password when prompted.
- Click Disconnect again on the confirmation screen.
- Restart your PC.
Note: After disconnecting from Azure AD, Windows 11 moves you to a local account. Confirm you have working local account credentials before you proceed, or you may lose access to your PC.
Fix 6: Remove the Account via Registry Editor
If the Settings option is missing and neither dsregcmd nor WPJCleanUp removed the account, delete the registration entry directly from the registry.
Warning: Back up your registry before making changes. Incorrect edits can cause system issues.
- Press Win + R, type
regedit, and press Enter. - Navigate to:
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\CloudDomainJoin\JoinInfo- Under JoinInfo, locate a subkey named with a long alphanumeric string (your tenant ID).
- Right-click that subkey and select Delete.
- Restart your PC.
If the key is protected and cannot be deleted, right-click the subkey, select Permissions > Advanced, click Change next to the Owner field, and take ownership before deleting.
Fix 7: Unenroll the Device from MDM
If your organization enrolled your device in Mobile Device Management (Intune or a third-party MDM), the enrollment policy may block account removal. Check your MDM status first:
dsregcmd /status | findstr "MDM"If MDMEnrolled : YES appears, try unenrolling through Settings:
- Press Win + I to open Settings.
- Go to Accounts > Access work or school.
- Click the enrolled account and select Info.
- Scroll down and click Disconnect.
If the Disconnect button is grayed out, the organization’s IT policy is blocking self-unenrollment. You need your IT administrator to remove the device from Intune or the MDM portal on their end.
Fix 8: Use a New Local Admin Account to Force Removal
If none of the above fixes work from your current account session, create a separate local administrator account and remove the Work or School account from there.
- Press Win + I > Accounts > Other users.
- Click Add account.
- Select I don’t have this person’s sign-in information, then Add a user without a Microsoft account.
- Set a username and password and click Next.
- Click the new account, select Change account type, and set it to Administrator.
- Sign out of your current session.
- Sign in with the new local admin account.
- Go to Settings > Accounts > Access work or school.
- Select the Work or School account and click Disconnect.
- Restart your PC.
Start with Settings > Accounts > Access work or school and the local account switch if the Disconnect button is blocked. For Workplace Joined devices, WPJCleanUp handles the cleanup automatically. For Azure AD-joined or Entra-registered devices, use dsregcmd /leave. The registry fix and the new local admin account method cover stubborn cases where all other options fail. If MDM policy is blocking removal, contact your IT administrator to release the device from their management system.
Related Guides
- How to Set Up a Passkey for Your Microsoft Account and Remove SMS Authentication
- Microsoft Teams Efficiency Mode: What It Does and How to Turn It Off
- How to Configure Windows 11 Pro for Hybrid Work Teams (Remote Desktop, Dynamic Lock, Group Policy)
- Microsoft Teams Keeps Asking for Location Permission on Mac: How to Fix It
