whitelist a domain for Teams online in a federated environment whitout using "-AllowedDomainsAsAList"

ISABEL LAVADO SANCHEZ 5 Reputation points
2023-01-12T11:34:47.53+00:00

Hello,

I need a solution to add domains to the whitelist without using -AllowedDomainsAsAList PS list modifier.

In my PROD environment, it doesn't work because the Teams module has a old version and doesn't support the parameter AllowedDomainsAsAList:
"set-cstenantfederationconfiguration does not support PS list modifier in the AllowedDomainsAsList in this version of module"

In this moment, I cannot upgrade to the latest version.

I'm trying to develop the same with "AllowedDomains" parameter type, but I see 2 things:

    • It doesn't allow to Add domains, but just Replace all the existing domains list, right?
  1. I cannot dinamically create the list $newAllowList. The examples I found are below, and they are building variables one by one. In my case, I have a 'variable' name of domains, so I don't know how to pass them to de Set-CsTenantFederationConfiguration
  • $x = New-CsEdgeDomainPattern -Domain "contoso.com"
  • $y = New-CsEdgeDomainPattern -Domain "fabrikam.com"
  • $newAllowList = New-CsEdgeAllowList -AllowedDomain $x,$y
  • Set-CsTenantFederationConfiguration -AllowedDomains $newAllowList

I would really appreciate your help, because I'm blocked with this issue.

Isabel.

Skype for Business Linux
Skype for Business Linux
Skype for Business: A Microsoft communications service that provides communications capabilities across presence, instant messaging, audio/video calling, and an online meeting experience that includes audio, video, and web conferencing.Linux: A family of open-source Unix-like operating systems.
456 questions
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. ISABEL LAVADO SANCHEZ 5 Reputation points
    2023-01-12T12:39:02.88+00:00

    I found the solution:
    I have to pass the complete list of domains like an array of arrays:

    User's image

     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"}
    
    
    0 comments No comments

  2. SokiGuo-MSFT 23,876 Reputation points Microsoft Vendor
    2023-01-13T09:42:27.2633333+00:00

    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 :

    User's image

    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.