Is it possible to send desktop notifications to all logged in users in Active Directory?

I would like to know if it's possible to create a C# program that sends real time custom desktop notifications to all logged in users in Active Directory.

If so, may I have some guidance?

Or is there already a built-in functionality in Windows Server to do it?

Thank you.

1 answer

  • answered 2019-02-11 14:13 Gabriel Luci

    Sure, it's possible.

    As mentioned in the comments, the only built-in option that's close to what you want is msg. But it probably won't work the way you want. You can only target one computer with it, so if you want to target every logged on user, then you need to repeat that command for every computer in your environment.

    You can try it yourself with this command:

    msg * "hello"

    That will send the message "hello" to every person logged on to the computer that you run it on (likely only you). Use the /server: option to send the message to another computer.

    If you want to make your own application, then it will need to be a client/server type application. The client application will:

    • Be pushed out to every computer in your environment
    • Automatically run when a user logs in (under their credentials, so you can pop up an interactive window - that's more difficult to do if you run it as a Windows service)
    • Either poll the server to see if a new message is available, or keep a connection open with the server so the server can push a message (depending on the size of your organization, you might run into problems keeping that many connections open)

    The server application will:

    • Have a UI, which allows you to add messages
    • Keep a database of the messages
    • Keep track of which computers have received and displayed the message
    • Probably other things