将用户添加到Microsoft Teams中的所有团队,包括私人团队。

huangapple go评论76阅读模式
英文:

Add a user to all channels including private channels in all Teams in Microsoft Teams

问题

我需要将用户添加到Microsoft Teams中所有团队的所有频道。

我尝试了这个:

Connect-MicrosoftTeams
$AllTeams = Get-Team

Foreach ($Team in $AllTeams)
{
    Add-TeamUser -GroupId $Team.GroupID -User 用户的电子邮件 -Role Owner
    Start-Sleep -Seconds 2
}

它会将用户添加到团队,但不会添加到所有频道,尤其是私有频道。

英文:

I need to add a user to all channels in all teams in Microsoft Teams.

I tried this:

Connect-MicrosoftTeams
$AllTeams = Get-Team

Foreach ($Team in $AllTeams)
{Add-TeamUser -GroupId $Team.GroupID -User USERS-EMAIL -Role Owner
Start-Sleep -Seconds 2}

And it adds them to the team but not all the channels, namely private channels.

答案1

得分: 1

Private channel membership is separate from Team membership; that's kind of the point of them being private; you don't want someone in a Team to have access to private channels within that Team automatically (even the owner of a Team doesn't automatically have access to any private channels, unless they create them or added to them). To add a user to a private channel requires the Add-TeamChannelUser command from the MicrosoftTeamsPowerShell module.

Use this line to add someone to a private channel of a specified team:

Add-TeamChannelUser -GroupId $Team.GroupID -User <USERS-EMAIL> -DisplayName <NAME OF CHANNEL> #New line

Adding someone to a private channel will complete within the PowerShell environment immediately but may take some time before that user shows up in the Teams client.

英文:

Private channel membership is separate from Team membership; that's kind of the point of them being private; you don't want someone in a Team to have access to private channels within that Team automatically (even the owner of a Team doesn't automatically have access to any private channels, unless they create them or added to them). To add a user to a private channel requires the Add-TeamChannelUser command from the MicrosoftTeamsPowerShell module.

Use this line to add someone to a private channel of a specified team:

Add-TeamChannelUser -GroupId $Team.GroupID -User <USERS-EMAIL> -DisplayName <NAME OF CHANNEL> #New line

Adding someone to a private channel will complete within the PowerShell environment immediately but may take some time before that user shows up in the Teams client.

huangapple
  • 本文由 发表于 2023年2月14日 02:46:59
  • 转载请务必保留本文链接:https://go.coder-hub.com/75440049.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定