Forum Discussion
Where does Teams get its user list from? I can't make sense of which accounts I see vs which I can't
Take this:
Sources of User Lists in Teams
- Azure Active Directory (AAD): Teams pulls user information from AAD, which includes all user accounts in your Microsoft 365 tenant. This is why even accounts that have never been licensed or activated for Teams (like Account 1) can still appear.
- Global Address List (GAL): Teams also references the GAL, which includes all mail-enabled objects in your organization. Accounts that were previously licensed and had mailboxes (like Account 2) can still show up if they were not properly removed from the GAL.
- Teams Cache: Teams maintains a local cache of user information, which can sometimes cause delays in reflecting changes made to user accounts.
Why Specific Accounts Show Up
- Account 1: This account shows up because it exists in AAD, even though it has never been licensed or activated for Teams.
- Account 2: This account shows up because it was previously licensed and mail-enabled, and it might still be present in the GAL.
- Account 3: This account does not show up because it has been removed from the GAL and Teams app has been disabled.
- Account 4: This account shows up because it is part of a multi-tenant organization and is recognized by Teams.
Steps to Manage Visibility
- Hide from GAL: Ensure that accounts you don't want to show are hidden from the GAL. This can be done using the Set-Mailbox cmdlet in PowerShell:
Set-Mailbox -Identity "email address removed for privacy reasons" -HiddenFromAddressListsEnabled $true
- Disable Teams for Specific Accounts: Use the Teams admin center or PowerShell to disable Teams for specific accounts.
- Clear Teams Cache: To force Teams to update its local cache, you can clear the cache manually:
- Close Teams.
- Navigate to %appdata%\Microsoft\Teams.
- Delete the contents of the Cache folder.
- Restart Teams.
So, regarding Account 2 (used to be active in teams, but no longer has a license), I tried an experiment.
I reassigned the license, changed the job title (so I could see when Teams had refreshed its reference) and waited... and waited... and waited... and several hours later, saw teams had picked it up.
As an aside, why does Teams take several hours to refresh this stuff? (It wasn't the local cache, I tried deleting it, no difference, this was in the server). "Efficiency" is no excuse, we're not talking about the contents of war and peace here, it's contact information! Half the world is on Discord and that will update practically instantaneously (hell even Outlook manages it in a semi-respectable timescale). And there seems to be no way to force a refresh of the server.
Anyway, back to the process
I then hid the account from the global address list and deselected "teams" from the apps, and waited... and waited...
Finally it disappeared from Teams, when I typed in the name that account did not come up any more.
Yay! Success!! Full of triumph I removed the license.
Only to find ( a few hours later obviously ) that it had reappeared.
So an account that doesn't appear on Teams when it has a license appears when you remove that license?
That's just dumb!