-
-
Save page2me/a7b076c0bcaf323ca83c1e4b2391de80 to your computer and use it in GitHub Desktop.
Revisions
-
mrik23 revised this gist
Sep 3, 2018 . 1 changed file with 3 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -11,7 +11,7 @@ $teamDisplayName = "" $groupID = "" #Team link template $teamLinkTemplate = "https://teams.microsoft.com/l/team/<ThreadId>/conversations?groupId=<GroupId>&tenantId=<TenantId>" #Connect to Microsoft Teams $connectTeams = Connect-MicrosoftTeams @@ -23,4 +23,5 @@ $team = Get-Team | Where-Object {$_.DisplayName -eq $teamDisplayName -or $_Group $channel = Get-TeamChannel -GroupId $team.GroupId | Where-Object {$_.DisplayName -eq "General"} | Select-Object -First 1 #Construct the team link $teamLink = $teamLinkTemplate.Replace("<ThreadId>",$channel.Id).Replace("<GroupId>",$team.GroupId).Replace("<TenantId>",$connectTeams.TenantId) $teamLink -
mrik23 created this gist
Sep 3, 2018 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,26 @@ <# Script to construct team link using Microsoft Teams PowerShell module. https://docs.microsoft.com/en-us/powershell/teams/intro https://www.powershellgallery.com/packages/MicrosoftTeams/ #> #Enter team display name or group ID $teamDisplayName = "" $groupID = "" #Team link template $teamLink = "https://teams.microsoft.com/l/team/<ThreadId>/conversations?groupId=<GroupId>&tenantId=<TenantId>" #Connect to Microsoft Teams $connectTeams = Connect-MicrosoftTeams #Retrieve the team via display name or group ID $team = Get-Team | Where-Object {$_.DisplayName -eq $teamDisplayName -or $_GroupId -eq $groupID} | Select-Object -First 1 #Retrieve team channel General (can be replaced by another Channel if needed) $channel = Get-TeamChannel -GroupId $team.GroupId | Where-Object {$_.DisplayName -eq "General"} | Select-Object -First 1 #Construct the team link $teamLink.Replace("<ThreadId>",$channel.Id).Replace("<GroupId>",$team.GroupId).Replace("<TenantId>",$connectTeams.TenantId)