none
Run As Account not able to create MS Teams Team RRS feed

  • Question

  • Dear Community,

    I have the following situation:
    There is a Run As Account created at my Automation Account. In my Runbook I use this Account to connect to MS Teams and to create a team there. Previously I assigned the "Teams Service Administrator" role to the Run As Account Service Principle.

    When I now execute my Runbook, I get the following execption:

    New-Team : Error occurred while executing 
    
    Code: UnknownError
    
    Message: 
    
    InnerError:
    
      RequestId: 03a13e98-4ee0-44af-b33a-8d7632975f3f
    
      DateTimeStamp: 2020-02-14T14:29:22
    
    HttpStatusCode: UnknownError
    
    
    
    At line:16 char:1
    
    + New-Team -DisplayName $teamname -Owner $teamowner -Visibility $visibi ...
    
    + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    
        + CategoryInfo          : NotSpecified: (:) [New-Team], ApiException
    
        + FullyQualifiedErrorId : 
    
    Microsoft.TeamsCmdlets.PowerShell.Custom.ErrorHandling.ApiException,Microsoft.TeamsCmdlets.PowerShell.Custom.NewTeam
    

    Here is my Runbook:

    Param(
    
        [string]$teamname, 
        [string]$teamowner, 
        [string]$visibility,
        [string]$Description
    
    )
    
    #Connect to Teams PowerShell
    Connect-MicrosoftTeams -TenantId xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx -ApplicationId xxxxxxxxxxxxxxxxxxxxxxxxxxxxx -CertificateThumbprint xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
    
    #Create the Team
    New-Team -DisplayName $teamname -Owner $teamowner -Visibility $visibility -Description $Description
    
    #Hangup
    Disconnect-MicrosoftTeams

    Many Thanks for your help!

    Michael

    Friday, February 14, 2020 2:40 PM

All replies