Hi everyone! I'm trying to figure out how to display toast notifications to all users currently logged into a Windows machine. We're rolling out software upgrades, and right now, our management solution closes applications without giving users any heads-up. This is definitely impacting their experience negatively.
The idea was to implement toast notifications before we close the apps, so users can save their work. However, I've run into a roadblock: the upgrade process runs under the system account, and it seems toast notifications can only be shown in a user's context.
Have you found any workarounds or solutions to this problem?
4 Answers
You might want to check out PSADT (PowerShell Application Deployment Toolkit). It has built-in support for showing notifications. Seriously, it makes the process so much easier. Just make sure you're using version 4 or later, since that one doesn’t require the serviceui to be packed with the installer. You can set it up to prompt users to save their work before the upgrade, and even block the application from launching until everything’s complete. It's super user-friendly if you’re familiar with PowerShell.
Another option is to create a scheduled task to show a message box to all users. Yeah, I know it’s not as sleek as a toast notification, but it's something if you want a quick fix. At least users will get a heads-up!
You can also leverage Azure or Entra with PowerShell to do this. Just a heads-up, though, it might take a bit to set up correctly.
For this kind of task, PSADT is definitely your best bet. It allows you to specify which processes to close, and it will alert all user sessions to close them before proceeding. It can work from the system context without needing serviceui.exe, which is good because of the security risks that come with it.

Related Questions
Can't Load PhpMyadmin On After Server Update
Redirect www to non-www in Apache Conf
How To Check If Your SSL Cert Is SHA 1
Windows TrackPad Gestures