Multiple MS Teams Accounts on the Desktop

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:

https://microsoftteams.uservoice.com/forums/555103-public/suggestions/17750851-i-want-to-use-multiple-teams-accounts-at-the-same

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.

Switching between organisations in MS Teams

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:

  1. A folder will be created in your user profile directory for each profile.
  2. 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 .cmd file.

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%"

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 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

Cyber Security References

Starting a new web based project? This is a reference of useful security related links and tools. Mostly web focused generally related to technologies I happen to be working with.

There are many related terms which are not all the same, but do share much overlap; WebSec/WebSecOps, DevSec/DevSecOps, Cyber/CyberSec/Cyber Security, SDLC. Security in general should be one of the first considerations when planning a new feature. As with most things in software development, the earlier security is considered the cheaper it is to apply its principles. I won’t go in to details on that philosophy in this post, but this is also known as shifting left which is common when talking about testing strategies.

This post contains a selection of resources related to Cyber Security for an easy reference. There are a lot of these out there, so this particular list is by no means exhaustive.

Continue reading