Issue With Teams PowerShell Module

Copper Contributor

There seems to be an ongoing issue with the Teams PowerShell Module. After reading on Microsoft's Teams PowerShell Module - Supported Versions, it seems that we will soon be forced to move to V4.x.x of the PowerShell Modules. However, as we have been using the Teams PowerShell Modules in the last few months, we can't go to V4.x.x yet, so I decided to look at the last public release V3.1.1. Sadly this suffers from the same issue that all the versions after 2.1.0-preview (which we are currently running) have, in that when you run Get-TeamChannelUser it returns the primary email address of the user and not the UPN, like the Get-TeamUser does. As our site has a different UPN and primary email address, this makes it really difficult when trying to compare users in a script to add into a team channel, as they would be completely different. Is there any way to get Microsoft to fix this?

2 Replies

@AlanH13 

 

Outside MSC, I don't believe we can get them to fix something direct by request :D.  I don't use the Teams Module and can't speak to your problem, but other than upgrading to V4 (if it has the fix you need), only thing I see is this: Give feedback in Teams

 

If you have an O365 business license you can also contact support, but for this I am not sure what could be done other than provide the feedback.

 

My initial thought was get the UPN from ActiveDirectory Module and pass it to the Teams Module to do what you need, but I assume you're aware of this and there is a reason why you can't leverage it into your scripts.  Though as Teams doesn't have UPN I suppose your issue is you can't verify users by UPN between the two because Teams doesn't pull UPN.  So in this instance I would select another variable that is consistent and matches, but again, I assume you are aware of this and I am simply typing my thoughts at this point :p

@Leavii 

 

You've probably come up with your own workaround, but waiting for Microsoft doesn't always pan out well. I'm still waiting on directory services parity some 13 years later.

 

For anyone else without a workaround, looking at it in "reverse" - from the Team backwards, this is one means you could adjust to suit your specific needs:

 

 

Get-Team | % { [PSCustomObject] @{ GroupId = $_.GroupId; DisplayName = (Get-TeamChannel -GroupId $_.GroupId).DisplayName } } | Get-TeamChannelUser | % { Get-MgUser -UserId $_.UserId }

 

 

If you're not familiar with Get-MgUser, it's from yet another "Azure AD" PowerShell module (one of many in the Microsoft.Graph set of modules) - the one that's replacing the soon-to-be-decommissioned AzureAD/AzureADPreview set of modules.

 

Microsoft.Graph.Users Module | Microsoft Docs

 

Cheers,

Lain