Send-RDUserMessage

Send-RDUserMessage

Sends a system message to a specified user session.

Syntax

Parameter Set: Default
Send-RDUserMessage [-HostServer] <String> [-UnifiedSessionID] <Int32> [-MessageTitle] <String> [-MessageBody] <String> [ <CommonParameters>]

Detailed Description

The Send-RDUserMessage cmdlet sends a system message to a specified user session. Because the user session ID is unique only within the context of a session host, a different session host server can share the same user session ID. The host server and session ID that you specify by using this cmdlet uniquely identify a session within a deployment.

Parameters

-HostServer<String>

Specifies the name of the server that hosts the session. For session collections the host server has the name of the Remote Desktop Session Host (RD  Session Host) server. For virtual desktop collections the host server has the name of the Remote Desktop Virtualization Host (RD Virtualization Host) server.

Aliases

none

Required?

true

Position?

1

Default Value

none

Accept Pipeline Input?

True (ByPropertyName)

Accept Wildcard Characters?

false

-MessageBody<String>

Specifies the text for the message body.

Aliases

none

Required?

true

Position?

4

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-MessageTitle<String>

Specifies the text for the message title.

Aliases

none

Required?

true

Position?

3

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-UnifiedSessionID<Int32>

Specifies a unique session ID on the host. Use Get-RDUserSession to retrieve the unique ID for a specific session.

Aliases

none

Required?

true

Position?

2

Default Value

none

Accept Pipeline Input?

True (ByPropertyName)

Accept Wildcard Characters?

false

<CommonParameters>

This cmdlet supports the common parameters: -Verbose, -Debug, -ErrorAction, -ErrorVariable, -OutBuffer, and -OutVariable. For more information, see    about_CommonParameters (https://go.microsoft.com/fwlink/p/?LinkID=113216).

Inputs

The input type is the type of the objects that you can pipe to the cmdlet.

Outputs

The output type is the type of the objects that the cmdlet emits.

  • System.Object

Examples

Example 1: Send a system message to users of a Remote Desktop application

This command sends a system message to users of the session with an ID of 1 on the host server named rdsh.contoso.com.

PS C:\> Send-RDUserMessage -HostServer "rdsh.contoso.com" -UnifiedSessionID 1 -MessageTitle "Message from Administrator" -MessageBody "Please save your work. You will be logged off in 10 minutes"

Disconnect-RDUser

Get-RDUserSession

Invoke-RDUserLogoff