Changing between multiple Teams accounts within the app or browser
I have some issue right now with the new Ms.Teams apps and done with your solution. Very helpful, thank you so much ablyth.
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
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.
Changing between multiple Teams accounts within the app or browser
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.
I have some issue right now with the new Ms.Teams apps and done with your solution. Very helpful, thank you so much ablyth.
This worked for me until a reboot the next day it came back
After i applied this fix the issue has not returned on any of the machines ive done it on.
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.
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