Forum Discussion
Hide Users from Teams Directory
This the Microsoft documentation on 'Limit who users can see when searching the directory in Teams'
https://learn.microsoft.com/en-us/microsoftteams/teams-scoped-directory-search
To achieve the objective of hiding users (guests or unlicensed users of MS Office 365), two steps need to be performed
1. Set "ShowInAddressList" property of user in Azure Entra/AAD. Unfortunately, I do not see option to perform this in Entra Portal. Only PowerShell scripts is possible, as follows.
Set-AzureADUser -ObjectId "email address removed for privacy reasons" -ShowInAddressList $false
2. Change MS Teams setting by following the link below.
https://learn.microsoft.com/en-us/microsoftteams/teams-scoped-directory-search
To turn on search by name, on MS Teams
In the Microsoft Teams admin center, select Teams > Teams settings. Note: In case Teams Admin Centre page not loading, open in Incognito mode
Under Search by name, next to Scope directory search using an Exchange address book policy, turn the toggle On.
When Scope directory search using an Exchange address book policy is turned on, all accounts that are marked as hidden in Exchange won't show up in Teams searches.
Note (as per above MS Teams documentation):
It may take a few hours for this change to take effect.
Turning on search by name hides the Search teams box and public teams listing in Join or create a team in Teams. It will also disable joining a team by typing /join in the command box at the top of Teams.