Msg is a command for sends a message to a user on a Remote Desktop Session Host server.
MSG command syntax
The msg command has a large number of possible options which makes it very powerful and flexible.
The syntax of the msg command is as follows:
msg {<username> | <sessionname> | <sessionID>| @<filename> | *} [/server:<servername>] [/time:<seconds>]
[/v] [/w] [<message>]
MSG command parameters
Msg Options |
|
PARAMETER |
DESCRIPTION |
<username> |
Specifies the name of the user that you want to receive the message. If you don't specify a user or a session, this command displays an error message. When specifying a session, it must be an active one. |
<sessionname> |
Specifies the name of the session that you want to receive the message. If you don't specify a user or a session, this command displays an error message. When specifying a session, it must be an active one. |
<sessionID> |
Specifies the numeric ID of the session whose user you want to receive a message. |
@<filename> |
Identifies a file containing a list of user names, session names, and session IDs that you want to receive the message. |
* |
Sends the message to all user names on the system. |
/server: <servername> |
Specifies the Remote Desktop Session Host server whose session or user you want to receive the message. If unspecified, /server uses the server to which you are currently logged on. |
/time: <seconds> |
Specifies the amount of time that the message you sent is displayed on the user's screen. After the time limit is reached, |
/v |
Displays information about the actions being performed. |
/w |
Waits for an acknowledgment from the user that the message has been received. Use this parameter with |
<message> |
Specifies the text of the message that you want to send. If no message is specified, you will be prompted to enter a message. To send a message that is contained in a file, type the less than (<) symbol followed by the file name. |
/? |
Displays help at the command prompt. |
You must have Message special access permission to send a message.
Examples
To send a message entitled, Let's meet at 1PM today to all sessions for User1 , type:
msg User1 Let's meet at 1PM today
To send the same message to session modeM02 , type:
msg modem02 Let's meet at 1PM today
To send the message to all sessions contained in the file userlist, type:
msg @userlist Let's meet at 1PM today
To send the message to all users who are logged on, type:
msg * Let's meet at 1PM today
To send the message to all users, with an acknowledgment time-out (for example, 10 seconds), type:
msg * /time:10 Let's meet at 1PM today