Powershell GUI – Quickly Message RDSH Collection Users!

The script:

import-module RemoteDesktop
Get-RDUserSession -ConnectionBroker connectionbroker.domain.local | select username, hostserver, unifiedsessionid |  Out-GridView -title "Select users to message" -passthru | Send-RDUserMessage -MessageTitle "Message from Tech Support" -MessageBody "Server will be rebooting shortly please save your work."

The result:
img 57b260c61b7bc
img 57b260d8a534f
After selecting “ok” this appears on the RDSH server.

img 57b260f4ae33f

Why does it work?
Well send-rdusermessage really only requires the hostserver, and unifiedsessionid, these are passed by the pipeline which lets us message the proper users!

Leave a comment