There are 2 users currently logged on a server via remote desktop protocol (RDP) and want to asked them to log out while I perform maintenance. There is a utility in Windows called MSG . It is a utility to send a message to a user that’s currently logged onto a system.
To send a message to a remote server, from the terminal:
$> msg * /server:SERVER1 /time:30 /v "Could either USER1 or USER4 logout until 1PM? I need access to prepare for the migration next week"
- * : I’m sending the message to all sessions
- /server: The name of the server I’m sending the message to.
- /time:30 : I’m giving the users 30 seconds to acknowledge the message. If no time is listed, the message will stay on the screen until the users click OK.
- /v : verbose
- The message to the users should be in quotes
This works in both PowerShell and command prompt.