A new version of the Windows 10 Toast Notification Script is here. The script is now being on version 2.1.0.
This version brings the option to add a second action button to the toast notification (displayed in the illustration below), as well as a built-in functionality to prevent users from disabling toast notifications in Windows 10 altogether.
A second action button is useful in many scenarios. One being with a Windows 10 upgrade, where you, besides the actual upgrade, also have some additional information for the user. In this example, Install Now will launch the actual upgrade, while Learn More will open a specific web page in the browser.
Prevention from disabling toast notifications is stolen with pride from Trevor Jones, and is incorporated into my script. More details down below. 🙂
- 2.1.0 – Added a second action button: ActionButton2
- This allows you to have 2 separate actions. Example: Action1 starts a task sequence, action2 sends the user to a web page for more info
- This will require new config.xml files
- Reworked Get-GivenName function
- Now looks for given name in 1) local Active Directory 2) with WMI and the ConfigMgr client 3) directly in registry
- Now checks 3 places for given name, and if no given name found at all, a placeholder will be used
- Fixed CustomAudioToSpeech option
- This part haven’t worked for a while it seems
- Only works properly with en-US language
- Added Enable-WindowsPushNotifications function // Thank you @ Trevor Jones: https://smsagent.blog/2020/11/12/prevent-users-from-disabling-toast-notifications-can-it-be-done/
- This will force enable Windows toast notification for the logged on user, if generally disabled
- A Windows service will be restarted in the process in the context of the user
The addition of a second action button requires that you update your existing config.xml files. The changes to the config.xml file is highlighted below. In this example, ActionButton1 will restart the computer, and the ActionButton2 will open https://imab.dk in the browser.
Prevention of disabling Toast Notifications
As mentioned in the introduction, this is an idea I picked up from Trevor Jones: https://smsagent.blog/2020/11/12/prevent-users-from-disabling-toast-notifications-can-it-be-done/
If your users are clever enough to disable toast notifications in Windows 10, I think this will be a useful addition to the script.
The setting which the prevention works for, is the one I highlighted below – and only that.
If toast notifications are disabled by the user, the script will try to re-enable them. Entries in the New-ToastNotification.log will indicate when that happens.
More prevention of disabling Toast Notifications?
And while I was brewing on this blog post, Trevor happened to share more nifty stuff on Twitter, as I was concerned for users disabling the notifications per app basis instead.
Usually when a toast notification appear for the user, the user has the option to ‘Turn off all notification” for the source. Turns out, this is something you can prevent as well.
The prevention of disabling toast notification per app basis, is something you do in registry by creating the AppID (Microsoft.SoftwareCenter.DesktopToasts) and create the ‘ShowInSettings’ DWORD value as shown below:
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.