The Windows 10 Toast Notification Script enables you to create nice and nifty toast notifications for the logged on user in Windows 10. This can be done with Configuration Manager or with Group Policy Preferences and Scheduled Tasks (and probably other means too).
This is an extended version of the script and scenario described in my last WaaS post: https://www.imab.dk/windows-as-a-service-remind-users-of-pending-windows-upgrades-using-windows-toast-notifications/. For inspiration, I suggest you have a peek at this too 🙂
The script comes with 3 main purposes/features:
UpgradeOS is meant to be used with Windows Servicing, notifying users about new available Windows versions. This is primarily intended to be used with ConfigMgr. The main idea here is to lure the end-user into a voluntary participation and make them initiate the in-place upgrade themselves.
The toast notification displayed for the end-user in such scenario, may look similar to below left example, where the Install button will redirect the user into the Software Center:
PendingRebootCheck is the second purpose/feature and is displayed above to the right. The idea here is to increase compliance and overall stability of the running computers by reminding users of pending reboots. Pending reboot here is checked in the registry and WMI.
PendingRebootUptime is the third purpose/feature. In this scenario, the uptime of the computer is considered. When the uptime exceeds the value defined in the config.xml, the toast is displayed reminding users to restart more often.
The entire toast notification is configurable through the config-toast.xml. The idea here is, that the purpose of the toast notification can be modified without the need to push new files and/or update distribution points in ConfigMgr. There are bits and pieces which cannot be changed from the config-toast.xml and in that case you will have to modify the actual Powershell script.
I have included 2 configuration samples in the download; one for use with Windows Servicing and another for checking for pending reboot.
The images are changeable. Just replace ToastHeroImage.jpg and ToastLogoImage.jpg with your own. Some of the images I’m using throughout my posts is paid pictures and protected by copyright.
ConfigMgr admins loves log files! The script logs all its actions to ProgramData\ToastNotificationScript\New-ToastNotification.log. This is useful when troubleshooting or if curious of what is done. Also, there are some combinations in the config-toast.xml which doesn’t makes sense and thus these are prevented. The log will tell when that happens.
I have included a first draft of the documentation in the download.
- 1.0 – Script created
- 1.1 – Separated checks for pending reboot in registry/WMI from OS uptime.
- 1.1 – More checks for conflicting options in config.xml.
- 1.1 – The content of the config.xml is now imported with UTF-8 encoding enabling danish, german etc. characters to be used in the text boxes.
- 1.2 – Added option for personal greeting using given name retreived from Active Directory. If no AD available, the script will use a placeholder.
- 1.2 – Added ToastReboot protocol example, enabling the toast to carry out a potential reboot.
- 1.3 – All text elements in the toast notification is now customizeable through the config.xml
- Expanded the options for finding given name. Now also looking in WMI if no local AD is available.
- Added Get-WindowsVersion function: Testing for supported Windows version
- Added Test-WindowsPushNotificationsEnabled function: Testing for OS toast blockers
- Added some more detailed logging
- Added contributions from @SuneThomsenDK @ https://www.osdsune.com
- Date formatting in deadline group
- Fixed a few script errors
- More text options