編輯

共用方式為


Send-RDUserMessage

Sends a system message to a specified user session.

Syntax

Send-RDUserMessage
    [-HostServer] <String>
    [-UnifiedSessionID] <Int32>
    [-MessageTitle] <String>
    [-MessageBody] <String>
    [<CommonParameters>]

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.

Examples

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

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"

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

Parameters

-HostServer

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.

Type:String
Position:0
Default value:None
Required:True
Accept pipeline input:True
Accept wildcard characters:False

-MessageBody

Specifies the text for the message body.

Type:String
Position:3
Default value:None
Required:True
Accept pipeline input:False
Accept wildcard characters:False

-MessageTitle

Specifies the text for the message title.

Type:String
Position:2
Default value:None
Required:True
Accept pipeline input:False
Accept wildcard characters:False

-UnifiedSessionID

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

Type:Int32
Position:1
Default value:None
Required:True
Accept pipeline input:True
Accept wildcard characters:False

Outputs

Object