Teams Multi-Instance
Allows running multiple independent instances of the new Microsoft Teams desktop app
Author: Sam Mahdi
The new Microsoft Teams desktop app only allows one instance per Windows
session — launching it again just activates the existing window. Teams
enforces this with two named mutexes, Teams-Tfw-instance and
Teams-Tfw-server. This mod appends the process ID to those names so each
launch believes it is the first one, letting you run e.g. your own tenant and
a client tenant side by side in two full Teams windows.
Usage
- Enable the mod.
- Quit Teams completely (tray icon → Quit) and start it again, so the first
instance is launched with the mod active.
- Start Teams again. Every additional launch opens a new independent
instance. Sign in to a different account/tenant in each one.
Each instance gets its own tray icon, with the process ID in the tooltip
(e.g. Microsoft Teams [20680]) so they can be told apart. Additional icons
usually land in the tray overflow (the ^ arrow). Quit each instance from
its own tray icon or from inside its window — closing a window only
minimises it.
Restart Teams after enabling, disabling, or changing the settings of the
mod. The mod decides once, when a Teams process starts, whether and how to
rewrite names, and keeps that decision — and the settings in effect at the
time — for the life of the process. A Teams instance that was already
running when the mod was enabled is left untouched; an instance started with
the mod active keeps its salt across mod updates and Windhawk restarts; and
settings changes only apply to Teams processes started afterwards.
How it works
Hooks NtCreateMutant / NtOpenMutant in ntdll and appends _<pid> to
object names matching the configured patterns. Only mutexes are hooked —
sections and events are deliberately left alone, since those fire on the
DLL-loader path and hooking them destabilises the process.
Each ms-teams.exe process uses its own PID as the salt. Only the top-level
Teams process creates or opens the Teams-Tfw-* objects; child
ms-teams.exe processes never touch them, so they need no shared salt.
Teams registers its tray icon with a fixed GUID, and Windows allows only one
icon per GUID, so a second instance would get no icon at all. The mod hooks
Shell_NotifyIconW in salted processes, drops the GUID so the icon is
identified by its window instead, and appends the PID to the tooltip.
Limitations
- All instances share the same Teams profile
(
%LOCALAPPDATA%\Packages\MSTeams_8wekyb3d8bbwe\LocalCache, including the
WebView2 user-data folder). Two Teams processes writing it concurrently is
exactly what the single-instance lock exists to prevent. This can corrupt
the profile, which means signing in again and rebuilding the cache. Avoid
signing in/out or changing settings in more than one instance, and use at
your own risk.
- Notification clicks and
teams:// links are routed by Windows activation
and may land in a different instance than the one you expect.
- Helpers that are not
ms-teams.exe (the Teams Meeting Add-in in Outlook,
the updater) are not hooked and cannot reach a salted instance's objects;
meeting-join from Outlook may target the wrong instance or none.
- Not supported by Microsoft.
Troubleshooting
Turn on Log only, then quit and restart Teams. The Windhawk log lists
every named mutex the new Teams process creates or opens without modifying
any of them (the interesting objects are created during startup, so a running
instance shows nothing useful). If a future Teams build renames the
single-instance objects, add the new name to Object name patterns, turn
Log only off, and restart Teams again.