Do you have multiple MS Teams accounts? Either across multiple tenants or even just a single account connected to multiple organisations?
I have, and I’ve also been quite frustrated with the inability to stay signed in to each account and easily switch between them.
Turns out a lot of other people have been frustrated by this as well, as this is the number two item on UserVoice for MS Teams right now. So before you continue reading this workaround, head over and add your vote:
For background, Microsoft have made some improvements over the last couple of years, including the ability to switch between orgs using a drop-down list in the top-right of the app. However, this still means you can only have one open at a time, and it is very slow to switch between them, taking many 10s of seconds each time.
The Android and iOS MS Teams apps do have better multi-account support, but still suffer from some of the same problems such as slow switching between accounts. You can also use multiple browser profiles, but that has it’s own limitations.
Now on the Desktop there is a nicer solution thanks to Francois Hill‘s post over at UserVoice.
So how do I use multiple accounts?
I’ve extended on the above comment a little bit to make it easy to re-use. Simply take the following batch script and save it to a text file with the
.cmd extension. E.g. for a “Company” profile you would save it as
Company.cmd. Here’s how it works:
- A folder will be created in your user profile directory for each profile.
- The profile will be stored in your local AppData directory.
The name of the file will be used as the “profile” name. This will create a folder in your When you run the script, a new folder will automatically be created alongside the
Create as many of these as you like! Once created, simply double click each launch script and a new MS Teams window will open.
@ECHO OFF REM Uses the file name as the profile name SET MSTEAMS_PROFILE=%~n0 ECHO - Using profile "%MSTEAMS_PROFILE%" SET "OLD_USERPROFILE=%USERPROFILE%" SET "USERPROFILE=%LOCALAPPDATA%\Microsoft\Teams\CustomProfiles\%MSTEAMS_PROFILE%" REM Ensure there is a downloads folder to avoid error described at REM https://gist.github.com/DanielSmon/cc3fa072857f0272257a5fd451768c3a mkdir "%LOCALAPPDATA%\Microsoft\Teams\CustomProfiles\%MSTEAMS_PROFILE%\Downloads" ECHO - Launching MS Teams with profile %MSTEAMS_PROFILE% cd "%OLD_USERPROFILE%\AppData\Local\Microsoft\Teams" "%OLD_USERPROFILE%\AppData\Local\Microsoft\Teams\Update.exe" --processStart "Teams.exe"
Update 17 May 2021: Added
mkdir command to workaround the following error:
Uncaught Exception: Error: Failed to get ‘downloads path at Object. Refer to the Gist for more details. Thanks xLAva for the tip!
Update 4 Apr 2020: Snippet and Gist updated to include extra quotes to support user name with spaces as per Gyarfas’s suggestion.
Also available in the following gist: https://gist.github.com/DanielSmon/cc3fa072857f0272257a5fd451768c3a
really cool solution, just a minor “observation” in case that the user profile name has spaces, the script works like this:
REM Uses the file name as the profile name
ECHO – Using profile “%MSTEAMS_PROFILE%”
ECHO – Launching MS Teams with profile %MSTEAMS_PROFILE%
“%OLD_USERPROFILE%\AppData\Local\Microsoft\Teams\Update.exe” –processStart “Teams.exe”
Thanks Gyarfas, as I don’t have spaces in my username I didn’t pick that up. I’ve now updated the Gist and snippet for others. Cheers!
Hello Daniel – This was just what our team needed with the multiple clients we work with. We did find a strange hiccup that if the guest account had an “&” sign the file name wouldn’t translate well into the script.
I like that approach.
How will it handle login credentials? Do I have to login each time on launching a different Teams profile? If yes, what’s the advantage compared to just log off and on again?
Best regards, Ulrich
It caches the credentials in each profile the same was as the “original” profile. So when I open all of my profiles after a reboot, they all log in automatically.
The other major benefit is that I can now keep three copies of MS Teams running side-by-side at the same time. So I get full desktop capability (e.g. like video blur), chat, notifications side by side for all of my orgs/accounts.
Hope that helps.
Uh! That indeed sounds very promising!
I’ll try that and eventually use all my PCs resources! 🙂
Because as a freelancer I’m usually dealing with up to 5 different Teams accounts at a time.
Best regards, Ulrich
Thank you for the trick. It works well.
How do you handle the way to join meetings? I cannot choose which account to use to join meetings.
Good point. Yes links will open in the default profile. The way I get around this is usually by switching to the profile/account window I want to use, selecting the “Calendar” icon on the left hand navigation and then joining the meeting from there.
Obviously if the meeting isn’t in any of your calendars then this will not work. But in that case, it may not matter which account/profile you use to join the meeting?
Hi Daniel, I tried this and works great. Except that if you try to download from file in a Team, it crashes. I tried to download an PPT, it gives me the prompt to download but then it blows up.
Thanks Jose, good to know. I haven’t had to use files in the different profiles yet so hadn’t noticed. Cheers.
For the downloads to work you should create a second user on your PC, switch account, install / login Teams on that account with the second credentials, and when you would switch Teams, you just switch between accounts.
Make sure that you have a OneDrive running for each instance you’re running in teams.
Without OneDrive running any file actions are going to fail
Hi there, does it work on a Mac computer? Thanks for your help.
Unfortunately this particular solution will only work on Windows. I switched over from macOS a couple of years ago so haven’t had a need to look into an equivalent workaround on macOS.
Thanks Dan, but looks like i am little lost here. Where can I create the folder and place this batch file? Do I need to update anything in the batch command?
Hi SS, you can save the batch/cmd file anywhere you like, and you don’t need to edit it at all. The way the script works is that it will take the file name (the bit before .cmd) and use that to create a new folder inside your User Profile directory. So you could put your .cmd file on your desktop if you like for easy access.
I tried this script and seeing below in cmd but unfortunately Teams is not opening for me also i verified that the custom profile folder is getting created.
– Using profile “Company”
– Launching MS Teams with profile Company
I am running it on Windows. Any help would be highly appreciated.
Hi Ravi, this is a hard one to troubleshoot. But I’d start by trying to run it manually using the original instructions and then move forward from there. You could also try removing your local MS Teams profile folders, but please be careful if you decide to do this.
Other things to consider are if you have any Group Policies applied to your machine.
Hope that helps,
Hi, Daniel. Is there any way to undo this?
Unfortunately, I selected the “Apply to all tenants” (or something similar) option, and no matter which file I select, it only opens that first one.
Thanks in advance!
Hi Mady, sorry I haven’t come across that before so not sure off the top of my head. Depending on where that “Apply to all tenants” option is stored, you might try deleting all of your local profile folders, but please be careful and make sure you back them up before hand.
Good luck. Cheers, Danel
Is there a way to have a different Icon in the taskbar for the second instance?
Unfortunately I’m not aware of an easy way of doing this. For example, if you change the shortcut icon, the icon changes back as soon as Teams launches. I haven’t spent much time digging around for a solution, but I suspect this may not be so easy as all instances end up running the same executable.
If anyone has found a way of changing the icon, I’d love to hear it!
This was working great for me for over a year. Thanks for much for posting it!
Unfortunately, something must have happened with an update this week, Now when I launch the cmd file I get an error box:
Error: Failed to get ‘downloads’ path at Object.
any ideas or help would be appreciated!
Error: Failed to get ‘downloads path
at Object. (C:\Users\[username]\AppData\Local\Microsoft\Teams\current\resources\app.asar\lib\loca…:54)
at Module.compile (C:\Users\[username]\AppData\Local\Microsoft\Teams\current\resources\app.asar\externa…:36)
at Object.Module.extensions..js (internal/modules/cjs/loader.js:986:10)
at Module.load (internal/modules/cjs/loader.js:816:32)
at Function.Module._load (electron/js2c/asar.js:748:26)
at Module.require (internal/modules/cjs/loader.js:853:19)
at require (C:\Users\[username]\AppData\Local\Microsoft\Teams\current\resources\app.asar\externa…:28)
at Object. (C:\Users\[username]\AppData\Local\Microsoft\Teams\current\resources\app.asar\lib\loca…:20)
at Module.compile (C:\Users\[username]\AppData\Local\Microsoft\Teams\current\resources\app.asar\externa…:36)“`
Any ideas on how to fix this?
Hi Chris and D B,
I haven’t seen this issue myself yet, it is still working normally for me. It could be that I’m in a slower ring so haven’t received the same updates as you guys yet. If anyone finds a solution please do let me know. I’ll keep an eye out myself and post any updates if I discover anything new.
Hi all, I’ve now also been able to repro this issue and thanks to xLAva’s tip learnt that creating a “Downloads” folder fixes this issue. I’ve updated the script in the snippet and gist to create this folder if it doesn’t exist, so you should be able to grab the latest version to get it working again.
Same thing here. Working fine until yesterday.
Please grab the latest version which should resolve this. Cheers!
This has started happening to me as well. Using the Batch file to support 2 Teams sessions was working before. I suspect a recent microsoft Patch.
Please grab the latest version which should resolve this. Cheers!
Working – Thanks for your help.
PS: I have renamed the .cmd file as EmailAddress.cmd
I expected this to automatically login using that profile but I still need to select the Account from a list in Teams. Have I renamed the .CMD file incorrectly?
Hi Lorenzo, the name of the file (i.e. the bit before .cmd) is just a unique folder to isolate a new instance of MS Teams running on your computer in parallel with ones from other profiles.
You will still need to log in or switch organisations after starting up that instance of teams. However, once you’ve logged in and switched orgs, that particular profile should remember that as a default setting when launched from that .cmd file.
Perhaps best to think of it as if you were logging into teams on multiple computers. Say you log in to a desktop and laptop, then on the desktop you select org1 and the laptop you select org2. When you close and re-open the desktop version it will default to org1, and the laptop would re-open with org2 until changed.
Hope that helps. Cheers!
It is working again.
Turns out the uservoice is deactivated with no clear successor currently. The link within Teams still points to the deactivated uservoice.
This works great, except for one issue, calendar invites. Our invites through Outlook generates the teams invite. When using this method, it uses the wrong invite details.
Instead of the primary teams invite the outlook account is associated with, it generates the invite details from the secondary account.
Clearing cache resolves the issue but only once, after that it does it again.
Would love to use this method as it’s a simple solution compared to the one i am using now, which requires a secondary windows account, but it does not have the invite issue.
I`m having the same issue with the outlook invitations.
You have mentioned an alternative solution using a secondary windows account, could you share this solution?