Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>I think some of you are <em>vastly</em> overthinking this. There is already a service built into every version of Windows that provides this exact functionality! It is called the Messenger service. All you have to do is ensure that this service is enabled and running on all clients.</p> <p>(Although you didn't specify in the question, I'm assuming from your choices of technology that the client population of this network is all Windows).</p> <p>You can send messages using this facility from the command line using something like this:</p> <pre><code>NET SEND computername "This is a test message" </code></pre> <p>The NET SEND command also has options to send by Windows domain, or to specific users by name regardless of where they are logged in, or to every system that is connected to a particular Windows server. Those options should let you easily avoid the subnet issue, particularly if you use domain-based security on your network. (You may need the "Alerter" service enabled on certain servers if you are sending messages through the server and not directly to the clients).</p> <p>The programmatic version of this is an API called <a href="http://msdn.microsoft.com/en-us/library/aa370605.aspx" rel="nofollow noreferrer">NetMessageBufferSend()</a> which is pretty straightforward. A quick scan of P/Invoke.net finds a <a href="http://www.pinvoke.net/default.aspx/netapi32/NetMessageBufferSend.html" rel="nofollow noreferrer">page for this API</a> that supplies not only the definitions you need to call out to the API, but also a C# sample program!</p> <p>You shouldn't need to write any client-side code at all. Probably the most involved thing will be figuring out the best set of calls to this API that will get complete coverage of the network in your configuration. </p> <p>ETA: I just noticed that the Messenger service and this API are completely gone in Windows Vista. Very odd of Microsoft to completely remove functionality like this. It appears that <a href="http://www.lantalk.net/netsend/" rel="nofollow noreferrer">this vendor has a compatible replacement</a> for Vista.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload