Comments on: Update Teams External Access Configuration With PowerShell https://practical365.com/teams-external-access-powershell/ Practical Office 365 News, Tips, and Tutorials Sat, 21 Oct 2023 16:56:33 +0000 hourly 1 https://wordpress.org/?v=6.3.2 By: Tony Redmond https://practical365.com/teams-external-access-powershell/#comment-271738 Wed, 09 Aug 2023 17:32:41 +0000 https://practical365.com/?p=57183#comment-271738 In reply to Clément BONNIN.

Using the MicrosoftTeams PowerShell module V5.5, this still works:

$Domain = “orange.fr”
Set-CsTenantFederationConfiguration -AllowedDomainsAsAList @{Add=$Domain}

The documentation https://learn.microsoft.com/en-us/powershell/module/skype/set-cstenantfederationconfiguration?view=skype-ps also confirms that the cmdlet still works as used in the script.

The point is that the script calculates domains from guest user accounts and updates the external configuration with those domains (one at a time). I could build a list object and commit them all together… maybe I’ll do that one day.

]]>
By: Clément BONNIN https://practical365.com/teams-external-access-powershell/#comment-271736 Wed, 09 Aug 2023 17:23:07 +0000 https://practical365.com/?p=57183#comment-271736 Here is the full script modified if it can be useful for somebody :
https://pastebin.com/G50BCVSj

Regards.
Clément BONNIN

]]>
By: Clément BONNIN https://practical365.com/teams-external-access-powershell/#comment-271735 Wed, 09 Aug 2023 17:15:16 +0000 https://practical365.com/?p=57183#comment-271735 Hello Tony,

Thanks so much for your script ! It helps a lot !
Unfortunaltely, I had to modify it a little to make it work.
As I’m working on multiple tenants, it’s better for me to add disconnects before MgGraph and MicrosoftTeams

But the main issue seems to be with “Set-CsTenantFederationConfiguration -AllowedDomainsAsAList”.
If I well understand, AllowedDomainsAsAList was only working with the old SkypeForBusiness PS module.

With some help :
https://learn.microsoft.com/en-us/answers/questions/1160191/whitelist-a-domain-for-teams-online-in-a-federated

I replaced it with “Set-CsTenantFederationConfiguration -AllowedDomains” and some other lines.

Thanks again,

Regards.

Clément BONNIN

]]>