Forum Discussion
Authenticating with an access token Connect-MicrosoftTeams
- Oct 15, 2021FYI - I raised a ticket, and it should be fixed by mid november.
Issue description:
Cannot properly run Connect-MicrosoftTeams -AccessTokens
Resolution Steps:
Escalated case with our engineering Team
Issue is known bug and currently being fixed
Expecting a fix to go out by NOV mid
Connect-MicrosoftTeams -AccessTokens @($graphtoken, $teamstoken) -Verbose -AccountId "user@domain.com"
to at least access the new cmdlets, but now I get
Parameter set cannot be resolved using the specified named parameters. One or more parameters issued cannot be used together or an insufficient number of parameters were provided.
- danielandrewbrowneAug 26, 2021Copper Contributor
MattLadewigWhen I do this I now get "Object reference not set to an instance of an object." on the Connect-MicrosoftTeams line.
- Andres-BohrenAug 26, 2021Iron Contributor
Using Teams 2.5.0
Does not work here. I've created a GitHub Issue to clarify the Permissions needed https://github.com/MicrosoftDocs/office-docs-powershell/issues/8194
Regards
Andres
- Andres-BohrenNov 15, 2021Iron Contributor
I am Using Teams PowerShell Module 2.6.1
But i am Still not able to Connect with the Access Tokens.
Any Updates?
- Andres-BohrenNov 17, 2021Iron Contributor
Tried with ClientSecret. Same Result.
$TenantId = "tenantname.onmicrosoft.com"
$AppID = "546f064a-baa2-4eb9-8b68-70c79b91942b" #TeamsPS
$ClientSecret = ConvertTo-SecureString "MyClientSecret" -AsPlainText -Force#GraphAccessToken
$Scope = "https://graph.microsoft.com/.default"
$Token = Get-MsalToken -clientID $AppID -ClientSecret $ClientSecret -tenantID $tenantID -Scope $Scope
$GraphAccessToken = $Token.AccessToken
$GraphAccessToken#TeamsAccessToken
$Scope = "48ac35b8-9aa8-4d74-927d-1f4a14a0b239/.default"
$Token = Get-MsalToken -clientID $AppID -ClientSecret $ClientSecret -tenantID $tenantID -Scope $Scope
$TeamsAccessToken = $Token.AccessToken
$TeamsAccessToken#Connect
$AccessTokens = @($GraphAccessToken,$TeamsAccessToken)
Connect-MicrosoftTeams -AccessTokens $AccessTokensRegards
Andres