Hi @ISABEL LAVADO SANCHEZ
Great to know that you've already thought of a solution and really appreciate it for your sharing!
By the way, since the Microsoft Q&A community has a policy that "The question author cannot accept their own answer. They can only accept answers by others. You could click the "Accept Answer" button for this summary to close this thread, and this can make it easier for other community member's to see the useful information when reading this thread. And according to the scenario introduced here: Answering your own questions on Microsoft Q&A, I would make a brief summary of this thread:
whitelist a domain for Teams online in a federated environment without using "-AllowedDomainsAsAList
"
Issue Symptom: Issues when adding domains to the whitelist, In PROD environments, the Teams module cannot be upgraded and doesn't support the parameter, nor can you create lists dynamically.
AllowedDomainsAsAList:
set-cstenantfederationconfiguration does not support PS list modifier in the AllowedDomainsAsList in this version of module
The Solution: The complete list of domains must be passed like an array :
if($DomainsToAdd.Count -gt 0)
{
$AllList = new-object object[] $CompleteDomainsList.Count
$i = 0
ForEach ($Domain in $CompleteDomainsList) {
$x = New-CsEdgeDomainPattern -Domain $Domain
$AllList[$i] = $x
$i++
}
$newAllowList = New-CsEdgeAllowList -AllowedDomain @($AllList)
# replace the current domains list for the new list generated above
Set-CsTenantFederationConfiguration -AllowedDomains $newAllowList
}
else
{ echo "No new domains to add"}
Thank you for your understanding and patience!
If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.