Summary
The built‑in MSG utility can only target a specific user or session on a machine that has the Terminal Services (Remote Desktop Services) service enabled. It cannot broadcast to every computer on a LAN with a wildcard like *. To reach all hosts you must enumerate them yourself and invoke MSG against each, or use a different mechanism (e.g., Group Policy, PowerShell remoting, or third‑party broadcast tools).
Root Cause
- MSG resolves the target name to a single machine or session;
*is not a valid wildcard in this context. - The command relies on the Remote Desktop Services (RDS) messaging channel, which must be running and properly configured on the destination host.
- Without a central directory (Active Directory) or a pre‑built host list, the command has no way to discover “all computers” on the network.
Why This Happens in Real Systems
- Security isolation: unrestricted network‑wide messaging would be a massive vector for spam and phishing.
- Service dependency: MSG works over the RDP messaging stack, which is deliberately scoped to authenticated sessions.
- Scalability concerns: broadcasting to thousands of machines could overwhelm the messaging service and flood logs.
Real-World Impact
- False expectations: administrators assume
MSG * "text"will reach every workstation, leading to missed alerts. - Operational gaps: critical notifications may never be delivered if the tech relies solely on MSG.
- Security audits: use of undocumented wildcards can be flagged as non‑compliant behavior.
Example or Code (if necessary and relevant)
# PowerShell one‑liner to broadcast a message to every computer in an AD domain
Get-ADComputer -Filter * | ForEach-Object {
msg.exe /SERVER:$_.Name * "System maintenance at 22:00"
}
How Senior Engineers Fix It
- Enumerate the target set (via DNS, DHCP leases, or Active Directory) and loop over each host.
- Enable and verify the “Remote Desktop Services” service and the
messengerendpoint on all endpoints. - Prefer modern tools: use PowerShell Remoting, WinRM, or Group Policy to push messages or scripts.
- Document the process and include fallback channels (email, Teams, etc.) for critical alerts.
Why Juniors Miss It
- They assume command‑line utilities behave like Unix
wallorbroadcasttools, ignoring Windows‑specific service requirements. - They overlook the need for service configuration and permissions on remote hosts.
- They often search for a “magic wildcard” without understanding the underlying RDS messaging architecture.