Backup and Restore of MS Teams External access federation domain list.

 Hello All,

Have you ever come across the situation, like all of sudden your Microsoft teams external federation allowed list got disappeared . 😢



Yes, It may possible and no guarantee, we are living in the world of cloud technology. No control in our hand.

Faced this situation and Microsoft much not helped, like how it got vanished, and who removed it. 

No answer from them, what we expected. Even they don't have our data in my case. 

The famous saying "prevention is always better than cure" 

One of the major task, which M365 administrator may think about the backup our data as much as possible within our control and limit

Again - the answer is Yes, it s possible to backup all the Microsoft teams external federation list from Microsoft team and export them in to safest path and we can restore it back whenever it needed

here is the script below 

#############################################################################

# Author : Ramakrishnan.Arumugam @Ramki

# Backuping the list of external federation list from Microsoft Teams

#############################################################################

connect-microsoftTeams

#$tenantid=$tenant.tenantid

#Getting Federation Info

$fc=Get-CsTenantFederationConfiguration

$alloweddom=$fc.AllowedDomains | select AllowedDomain

$fedallow=$alloweddom.AllowedDomain

$csv = $fedallow | select domain 

$csv | Export-csv  -NoTypeInformation -Force -Path "C:\Itsme\Allexternalfedlist_$((Get-Date).ToString('MM-dd-yyyy')).csv" -Append

you can  also scheduled the above script on your convenient day and time to run

Restore Process: 

With the help of Set-CsTenantFederationConfiguration , we can restore it in quick way

PS C:\Ramki> $fed1 = Import-Csv -Path "C:\itsme\Allexternalfedlist.csv"

PS C:\Ramki> $fed1 | % {Set-CsTenantFederationConfiguration -AllowedDomainsAsAList @{Add=$_.domain}}


Comments