Open robinmalik opened 2 years ago
Thank you for your feedback. This has been routed to the support team for assistance.
@robinmalik Apologies for the late reply. Thanks for reaching out to us and sharing this feedback. I am tagging the Service Team to look into this Feature Request ask.
Description of the new feature
Currently, use of Send-AzWvdUserSessionMessage is a touch cumbersome. In order to run it, you need to first get (at least) a session id from
Get-AzWvdUserSession -ResourceGroupName RGNAME -HostPoolName HOSTPOOLNAME
. Example returned object:Based on this output (noting the absense of properties for
UserSessionId
orSessionHostName
), an example of what must be then provided to send a message to a single user:Send-AzWvdUserSessionMessage -ResourceGroupName RGNAME -HostPoolName HOSTPOOLNAME -SessionHostName SESSIONHOSTNAME.domain.com -UserSessionId 6 -MessageTitle 'This is a message from PowerShell' -messagebody 'Hello!'
This requires parsing properties from the output of
Get-AzWvdUserSession
for the UserSessionId and SessionHostName.Proposed implementation details (optional)
The
Id
property on the object returned fromGet-AzWvdUserSession
contains enough data to pipe toSend-AzWvdUserSessionMessage
; it contains the resource group name, the host pool name, the session host name and the id of the session.To send a message to all users:
Get-AzWvdUserSession -ResourceGroupName RGNAME -HostPoolName HOSTPOOLNAME | Send-AzWvdUserSessionMessage -MessageTitle 'This is a message from PowerShell' -messagebody 'Hello!'
Failing pipeline support, an additional property could be added to the
Send
cmdlet, that accepts theId
value from theGet
cmdlet.Get-AzWvdUserSession -ResourceGroupName RGNAME -HostPoolName HOSTPOOLNAME | Foreach-Object { Send-AzWvdUserSessionMessage -NewPropertyName $_.Id -MessageTitle 'This is a message from PowerShell' -messagebody 'Hello!' }