英文:
how to sent-RdsUserSessionMessage to users who is using the sessionhost?
问题
我想要发送消息给用户。我找到了Send-RdsUserSessionMessage。
- 我想要发送消息给正在使用特定 SessionHostName 的所有用户。
- 是否可以向一个主机池中的已分配会话主机发送消息?
示例如下:
示例 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.
- I want to send message to all users who is using the special
SessionHostName. - 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!
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论