如何向正在使用会话主机的用户发送RdsUserSessionMessage?

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

how to sent-RdsUserSessionMessage to users who is using the sessionhost?

问题

我想要发送消息给用户。我找到了Send-RdsUserSessionMessage

  1. 我想要发送消息给正在使用特定 SessionHostName 的所有用户。
  2. 是否可以向一个主机池中的已分配会话主机发送消息?

示例如下:

示例 1:通过提供所有必需的信息发送消息给用户会话

PS C:\> Send-RdsUserSessionMessage -TenantName "contoso" -HostPoolName "contosoHostPool" -SessionHostName "sh1.contoso.com" -SessionId 1 -MessageTitle "Test announcement" -MessageBody "Test message."

示例 2:通过搜索他们的用户会话向用户发送消息

PS C:\> Get-RdsUserSession -TenantName "contoso" -HostPoolName "contosoHostPool" | where { $_.UserPrincipalName -eq "contoso\user1" } | Send-RdsUserSessionMessage -MessageTitle "Test announcement" -MessageBody "Test message." -NoUserPrompt
英文:

I want to send message to the users. I found the Send-RdsUserSessionMessage.

  1. I want to send message to all users who is using the special
    SessionHostName.
  2. Is it possible to send message to assigned session host of one host pool?

And the samples are as below:

Example 1: Send a message to a user session by providing all required information

PS C:\> Send-RdsUserSessionMessage -TenantName "contoso" -HostPoolName "contosoHostPool" -SessionHostName "sh1.contoso.com" -SessionId 1 -MessageTitle "Test announcement" -MessageBody "Test message."

Example 2: Send a message to a user by searching for their user session

PS C:\> Get-RdsUserSession -TenantName "contoso" -HostPoolName "contosoHostPool" | where { $_.UserPrincipalName -eq "contoso\user1" } | Send-RdsUserSessionMessage -MessageTitle "Test announcement" -MessageBody "Test message." -NoUserPrompt

答案1

得分: 1

Regarding #1,基于此文档中的描述部分,我相信您可以使用Get-RdsUserSession命令来列出在指定主机池中运行的所有用户会话,并与Send-RdsUserSessionMessage命令一起使用管道来向所有这些用户会话发送消息。

Regarding #2,基于此文档中的示例1和此文档中的描述部分,我相信可以分配一个主机池中不同的会话主机名称。

希望这些信息对您有帮助!

英文:

Regarding #1, based on description section in this document I believe you can lists all user sessions running on the session hosts in the specified host pool using Get-RdsUserSession cmdlet and then pipeline with Send-RdsUserSessionMessage cmdlet to send message to all those user sessions

Regarding #2, based on example 1 in this document and description section in this document I believe it is possible to assign different session host names of one host pool

Hope this information helps!

huangapple
  • 本文由 发表于 2020年1月6日 17:00:06
  • 转载请务必保留本文链接:https://go.coder-hub.com/59609190.html
匿名

发表评论

匿名网友

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

确定