How to Use the msg Command to Send Network Messages in Windows 11

The Need for Instant Administrative Alerts

If you are a system administrator managing a network of Windows computers, there are times when you need to instantly communicate with active users. For example, if a critical file server is about to go down for emergency maintenance, sending an email is useless—users might not check their inbox for hours, and they will lose unsaved work when the server disconnects.

You need a way to force a pop-up alert directly onto their screens. In older versions of Windows (like XP), administrators used the infamous net send command. In modern versions of Windows 11 (Pro and Enterprise editions), this has been replaced by the much more secure and powerful msg command.

Step 1: Open the Command Prompt

Because you are injecting a pop-up window into another user’s session, you must run this command with administrative privileges.

  1. Press the Windows Key, type cmd.
  2. Right-click on Command Prompt and select Run as administrator.

Step 2: Sending a Message to a Specific User

The syntax for the msg command requires you to specify the target (who is receiving the message) and then the actual text of the message.

If you want to send a warning to a coworker whose username is jsmith, run:

msg jsmith "Please save your work, the database is rebooting in 5 minutes."

Within seconds, a small, gray dialog box will physically pop up in the center of John Smith’s screen, interrupting his workflow with your exact text. The box will stay there until he clicks “OK” to acknowledge it.

Step 3: Sending a Message to an Entire Server

The msg command is incredibly useful on Windows Terminal Servers (Remote Desktop Services), where dozens of employees might be logged into the exact same physical server simultaneously.

If you need to reboot that specific server, you must warn everyone currently logged in. Instead of typing every username individually, you can use the asterisk (*) wildcard to target every active session.

msg * "WARNING: This terminal server is rebooting in 10 minutes. Log off immediately."

Every single user currently connected to that machine will instantly receive the pop-up alert.

Step 4: Targeting Remote Computers

By default, if you just type msg jsmith, the command assumes John Smith is logged into the exact same computer you are currently using. If John is sitting at his own laptop across the building, you must specify his computer’s hostname using the /server: flag.

msg * /server:DESKTOP-FINANCE-01 "Update your antivirus software now."

(Note: For the /server: flag to work successfully across a network, both computers must be on the same Active Directory domain, and the target computer must have the “Allow Remote RPC” firewall rule enabled in the Windows Defender Firewall).

Step 5: Enforcing a Time Limit

If you send a critical alert that a server is rebooting in 5 minutes, but the user is away from their desk grabbing coffee, they will return to a rebooted computer with a pointless, outdated message still sitting on their screen.

You can use the /time: flag to give the message an expiration timer (in seconds). If the user does not click “OK” before the timer runs out, the pop-up will automatically delete itself from their screen.

msg * /time:300 "The server is rebooting. This message will self-destruct in 5 minutes."

Get the best tech tips delivered straight to your inbox.

Join thousands of readers mastering Apple, Google, Microsoft, and Linux.