Windows 10 Toast Notification Script Update: Custom notification app and more built-in prevention from disabling toast notifications

Introduction

It’s been a while since the last update on this script. I admit that. Better late than never, I guess.

This update brings a slight improvement to the looks of the toast notifications, and (almost) definitely removes the option for the end-user to disable the notifications as well.

Also, I was wondering about naming the script differently. The script surely works with Windows 11 too, but seeing the entire toast framework was introduced with Windows 10, and Windows 11 behind the scenes is still appearing as version 10.0, I will stick with the current name.

What’s New

  • 2.3.0 – Added the Register-CustomNotificationApp function
    • – This function retrieves the value of the CustomNotificationApp option from the config.xml
    • – The function then uses this name, to create a custom app for doing the notification.
      • – This will reflect in the shown toast notification, instead of Software Center or PowerShell
      • – This also creates the custom notifcation app with a prevention from disabling the toast notifications via the UI

Config.xml

The addition of the new option to create a custom notification app, requires you to update your existing config.xml files. The changes to the config.xml file is highlighted below, and the results are shown in the picture above.

Register-CustomNotificationApp

The magic lies within this function in the script. Bits and pieces are borrowed from Mr. Trevor Jones @ https://smsagent.blog.

What I do differently, is to write the details into HKCU, so the script – once running in user context – is able to write to the relevant area of registry.

I also add an icon to the notification app, which in this scenario is a small cogwheel. See the header-image for the exact illustration.

Prevention of disabling Toast Notifications

The (almost) definitely prevention from disabling the toast notifications, comes from the ‘ShowInSettings’ DWORD value in registry. Almost because this is written to HKCU, and users with knowledge of registry, can obviously modify this themselves.

This is the area of registry, which the script creates automatically for you, based on the content of the config.xml.

Download

Download everything fromΒ GitHubΒ here:Β https://github.com/imabdk/Toast-Notification-Script

If any questions, please leave them down below and I am happy to assist with any issues.

ENJOY πŸ™‚

17 thoughts on “Windows 10 Toast Notification Script Update: Custom notification app and more built-in prevention from disabling toast notifications”

  1. Martin, thank you for great work.
    I was wondering why other xml config files have both UseSoftwareCenterApp and CustomNotificationApp set to ‘True’
    I am trying to run some configs manual to test and getting an error:
    Error. You can’t have both SoftwareCenter app set to True AND CustomNotificationApp set to True at the same time. Check your config
    I can run the script if i change SoftwareCenter to False.
    Can and should i have both set to true when running from SCCM?
    Thank you.

    Reply
    • Right, that just me forgetting to reset those values back to False. Ideally and with the new version, you set both Software Center and PowerShell to False, and configure CustomNotificationApp to True and with the desired value. πŸ™‚

      Reply
  2. Hi Martin, at the beginning thank you so much for this amazing work. I want to ask because I did not test your script yet, can the scrip allow us to change the logo to the company logo? Can we add more than one portion to the user for restart like , 1 hour, 2 , etc. ? Finally can we custom the message to meet the app or the deployment we use it for?

    Reply
  3. Hi Martin, first of all, a big thank you for this! Would there be a way to get some kind “confirmation message/button” after user press “Install” (OS Upgrade)? Like: “Have you saved all your work before continuing? Press “yes” to continue OS Upgrade”. Thank you.

    Reply
    • Yeah, you can leverage PowerShell App Deployment Toolkit to add even further user-friendliness to the process. I have a blog post covering that as well. So instead of launching the OS directly on the install button, the install button launches PSADT that have that extra confirmation you seek. Search for PowerShell App Deployment Toolkit on my blog πŸ™‚

      Reply
  4. Hi Martin, first of all, a big thanks for your efforts, this is amazing work. for some reason when I try to test it by removing your website from the Toast notification, through some errors, also, can I change the time and give the user an option to snooze it if they are in the middle of something?
    Please advise

    Thanks,
    Matt

    Reply
  5. Hi Martin –

    I am getting the toast notifications but I am iMAB.DK NOTIFICATIONS and that I have a new notification, no hero images or additional text. Any thought?

    Reply
    • Have you made any changes to the config.xml you are using? Run the New-ToastNotification.ps1 directly from the download, without changing anything in any config.xml. verify this works and make changes from there. The log file in appdata\ToastNotificationScript is helpful to paste here too.

      Reply

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.