New Teams - How do you remove users from the "Pick an account" / Login screen?

Anonymous
2023-12-01T12:57:48+00:00

While testing "New Teams" I have noticed that the "Pick an account" / Login screen shows the previous users that have logged in, even if they have clicked "sign out".

When clicking on those users, it also logs them in without asking for a password.

After reading other posts here, I have tried deleting the cache here: %LocalAppData%\Packages\MSTeams_8wekyb3d8bbwe

And also deleting the data in this folder: %LocalAppData%\Packages\Microsoft.AAD.BrokerPlugin_cw5n1h2txyewy

Doing this has stopped the accounts from being logged in without a password, but the accounts still appear on the "Pick an account" / Login screen.

They do not show in classic teams or any other application and there are no additional accounts in the "Access Work and School" windows setting page.

I have also tried to fully remove and reinstall Teams but the accounts are still visible.

Does anyone have a solution for this?

Thanks

EDIT:

I have found a possible solution:

Delete:
%LocalAppData%\Packages\MSTeams_8wekyb3d8bbwe
%LocalAppData%\Packages\Microsoft.AAD.BrokerPlugin_cw5n1h2txyewy
%LocalAppData%\Microsoft\OneAuth
%LocalAppData%\Microsoft\TokenBroker
%LocalAppData%\Microsoft\IdentityCache

Then restart the PC.

This will sign out all Microsoft products but does remove the users from the login list and removed their login details, meaning a password is required to login to Teams.

Microsoft Teams | Microsoft Teams for education | Sign up and Sign in | Switch between accounts

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments

99 answers

Sort by: Most helpful
  1. Anonymous
    2024-02-27T11:43:59+00:00

    Hi, I assume Teams is storing the accounts in the same location as the azure login accounts. The accounts must be somewhere in those folders, so it may be worth looking inside those folders and only deleting specific sub folders/files to see if you can retain the Azure logins while removing the teams logins.

    If you have any success let me know.

    Was this answer helpful?

    0 comments No comments
  2. Anonymous
    2024-02-21T16:28:35+00:00

    I tried various methods here without success until I combined various methods together. A bit of "a belt and braces" approach. Or a scatter gun approach and hoping something worked. Which it did. I now need a more elegant script and gradually remove the unnecessary commands. I know I have del and ren commands which probably conflict.

    Anyway, this worked on a test laptop. When I open Teams now, its like a brand new install without any accounts remembered.

    I can't take all the credit or blame. Like I said, I copied parts of other scripts here and other parts I found on other forums......

    This runs as a batch file in the startup folder of the generic account that logs into Windows on a shared conference laptop.

    That's why we don't want individual users' Teams accounts appearing in the accounts to choose.

    pushd "C:\Users<USERNAME>\Downloads" 2>nul && ( rd /Q /S "C:\Users<USERNAME>\Downloads" 2>nul & popd )

    taskkill /F /IM Teams.exe

    taskkill /F /IM msteams.exe

    taskkill /F /IM "Microsoft.AAD.BrokerPlugin.exe"

    del "C:\Users<USERNAME>\AppData\Roaming\Microsoft\Teams\desktop-config.json" /q

    rmdir "C:\Users<USERNAME>\AppData\Local\Packages\Microsoft.AAD.BrokerPlugin_cw5n1h2txyewy" /s /Q

    del "C:\Users<USERNAME>\AppData\Local\Packages\MicrosoftTeams_8wekyb3d8bbwe\*.*" /F /s /Q

    del "C:\Users<USERNAME>\AppData\Roaming\Microsoft\Windows\Recent\*.*" /F /s /Q

    del "C:\Users<USERNAME>\AppData\Roaming\Microsoft\Windows\Network Shortcuts\*.*" /F /s /Q

    ren C:\Users<USERNAME>\AppData\Local\Microsoft\OneAuth\accounts accounts_old

    ren C:\Users<USERNAME>\AppData\Local\Packages\MSTeams_8wekyb3d8bbwe MSTeams_8wekyb3d8bbwe_OLD

    ren C:\Users<USERNAME>\AppData\Packages\Microsoft.AAD.BrokerPlugin_cw5n1h2txyewy" "Microsoft.AAD.BrokerPlugin_OLD

    ren C:\Users<USERNAME>\AppData\Microsoft\OneAuth OneAuth_OLD

    ren C:\Users<USERNAME>\AppData\Microsoft\TokenBroker TokenBroker_OLD

    ren C:\Users<USERNAME>\AppData\Microsoft\IdentityCache IdentityCache_OLD

    ren C:\Users<USERNAME>\AppData\Microsoft\Teams Teams_OLD

    reg delete HKEY_CURRENT_USER\SOFTWARE\Microsoft\Office\Teams /f

    Feel free to recommend changes to make it more elegant

    Regards,

    Michael

    Was this answer helpful?

    0 comments No comments
  3. Anonymous
    2024-02-21T10:37:29+00:00

    Looked at the script. All the ren commands point to %LocalAppData% which on my computer points to C:\Users<username>\AppData\local. And it end into the folder local. But the 2 first ren command, has the Local folder after the %LocalAppData%. That means that these 2 ren command are looking for a folder under C:\Users<username>\AppData\local\Local.... which doesn't exist(At least on my pc). So it looks like the 2 first ren commands are pointing to a location that probably doesn't exist. I think those 2 should point to "%LocalAppData%\Microsoft\OneAuth\accounts" and "%LocalAppData%\Packages\MSTeams_8wekyb3d8bbwe". Just an observation, haven't tested it.

    Was this answer helpful?

    0 comments No comments
  4. Anonymous
    2024-02-15T10:59:37+00:00

    After i applied this fix the issue has not returned on any of the machines ive done it on.

    Was this answer helpful?

    0 comments No comments
  5. Anonymous
    2024-02-15T10:04:26+00:00

    This worked for me until a reboot the next day it came back

    Was this answer helpful?

    0 comments No comments