Office-docs-powershell: Connect-MicrosoftTeams Limitation With -TeamsEnvironmentName And -CertificateThumbprint

Created on 7 Apr 2020  路  7Comments  路  Source: MicrosoftDocs/office-docs-powershell

When Connect-MicrosoftTeams is used with -CertificateThumbprint and -ApplicationId, the parameter set restrictions do not allow use of -TeamsEnvironmentName. This is a problem because if -TeamsEnvironmentName TeamsGCCH is not specified when connecting to a TeamsGCCH tennant, some cmdlets such as Get-Team will fail with the following error:

image

Some cmdlets will work (such as Get-TeamUser) without specifying -TeamsEnvironmentName TeamsGCCH, but notably these cmdlets connect to graph.microsoft.com instead of graph.microsoft.us which is also not desirable. The fact the cmdlets even partly work potentially present an information security issue.

Can the Connect-MicrosoftTeams parameter set be altered to support specifying -TeamsEnvironmentName TeamsGCCH when using -CertificateThumbprint and -ApplicationId or is there a workaround that can be used?

teams

Most helpful comment

@get-itips I agree that no documentation needs to be changed. The only reason for even mentioning it here (which I recognize is a repository for documentation), is because the the MicrosoftTeams module's "Project Site" link points here, and simple changes on uservoice seem to be obfuscated by functionality requests that obviously get many more votes.

All 7 comments

Alright, I developed a workaround for this by replacing the default environment ('AzureCloud') properties with the parameters of the government environment. However, this would be easily fixed by adjusting the cmdlet parameter set properties so hopefully somebody can adjust it on the Microsoft side for the next version of the cmdlet.

Import-Module MicrosoftTeams
[Microsoft.Open.Teams.CommonLibrary.AzureEnvironment]::PublicEnvironments.Remove('AzureCloud')
[Microsoft.Open.Teams.CommonLibrary.Models.TeamsEnvironment]::setMsGraphEndPoint('TeamsGCCH',`
   [Microsoft.Open.Teams.CommonLibrary.AzureEnvironment]::PublicEnvironments['AzureUSGovernment'])
[Microsoft.Open.Teams.CommonLibrary.AzureEnvironment]::PublicEnvironments['AzureUSGovernment'].Name = 'AzureCloud'

Connect-MicrosoftTeams --CertificateThumbprint ...

@officedocsbot assign @yogkumgit

Thank you for raising this issue and sharing your workaround! I'm presently following-up with our team on next steps.

Thanks @brandber Brandon for your feedback here!
@NoMoreFood As the documentation currently shows that behavior in the parameter set, I do not see a need for a change in documentation. If the cmdlet is updated with your valuable feedback, we will proceed updating the cmdlet's article.
Thanks

@get-itips I agree that no documentation needs to be changed. The only reason for even mentioning it here (which I recognize is a repository for documentation), is because the the MicrosoftTeams module's "Project Site" link points here, and simple changes on uservoice seem to be obfuscated by functionality requests that obviously get many more votes.

@get-itips I agree that no documentation needs to be changed. The only reason for even mentioning it here (which I recognize is a repository for documentation), is because the the MicrosoftTeams module's "Project Site" link points here, and simple changes on uservoice seem to be obfuscated by functionality requests that obviously get many more votes.

No issues at all, I just need to explain the reason I can not take any action on the documentation -for now- ;)

Thank you!

@get-itips Thank you very much for the contribution and sharing this explanation. @NoMoreFood
Hope this comment is helpful for you. If you see a documentation update is required, please feel free to open an issue for the same. We proceed here to close it. Thanks for taking out some time to open the issue. Appreciate and encourage you to do the same in future also.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

federico-r-figueredo picture federico-r-figueredo  路  5Comments

savusca picture savusca  路  4Comments

BlasMS picture BlasMS  路  5Comments

KevinNSTA picture KevinNSTA  路  4Comments

tomlarse picture tomlarse  路  5Comments