Learn a Microsoft Teams Team Link using PowerShell

How to learn Team Connectivity in Microsoft Teams using PowerShell in this note This topic has been addressed.

Powershell ISE opens as an administrator because script is used primarily in this study.

Teams connection is established with the powershell team module as above using the code below.

Import-Module MicrosoftTeams
$userCredential = Get-Credential
Connect-MicrosoftTeams -Credential $userCredential

After the connection is established, the following script runs in a new tab, such as above. The following example provides a link to the “General” channel of the “Test Team”.

# Input Parameters
$teamName=”Test Team”
$channelName=”General”

# Get the tenant ID
$tenantId=$connectTeams.TenantId

# Get the team
$team=Get-Team -DisplayName $teamName

# Get the Group Id
$groupID=$team.GroupId

# Get the channel
$channel=Get-TeamChannel -GroupId $groupID | Where-Object {$_.DisplayName -eq $channelName}

# Get the channel ID
$channelId=$channel.Id

# Get the Team link
$teamLink= “https://teams.microsoft.com/l/team/”+$channelId+”/conversations?groupId=”+$groupID+”&tenantId=”+$tenantId;
Write-Host -F Green $teamLink
Write-Host -F Green $teamName

n the following format, an output will be obtained in the form of team link address and team name first.

https://teams.microsoft.com/l/team/19:54de11e519604e129b3dcf513f653351@thread.tacv2/conversations?groupId=2e11f86f-b4c4-4354-90b1-1cd13e8a1fc5&tenantId=9bf387fc-915a-4cd0-9e38-4e77e13466425

Test Team

 

See also  Disabling chat in meetings organized within Teams

Leave a Comment