Proactive Remediation reboot reminders via Toast Notifications
Regularly rebooting user devices is crucial for maintaining optimal performance and stability. Over time, as well all know, a computer's resources become strangled by various applications that run automatically on startup and consume memory and processing power. Restarting the device clears all processes and resources, allowing the computer to start afresh. This can also resolve hardware and software issues that may have accumulated over time. This PowerShell Intune Proactive Remediation helps remind users to reboot their computers by displaying a customizable toast notification reminder.
The code uses the PowerShell Get-ComputerInfo cmdlet to retrieve information about the computer's operating system uptime. The script then checks if the number of days since the last system reboot is greater than or equal to 7 days. If the condition is true, the script outputs a message to notify the user to reboot the device and exits with a code of 1. Alternatively, if the condition is false, the script outputs a message that indicates the number of days since the last system reboot and exits with a code of 0, which means that everything is okay. Intune will then take this output and run the remediation script as necessary.
The remediation script displays a toast notification on the user's device reminding them to restart their computer for performance and stability reasons. The script fetches a logo image from an external URI of your choosing and defines the notification settings such as title, header, and body text. Finally, the script sets up the XML for the toast notification and sends it to the user's device.
Deploying via Intune
Navigate to your Proactive remediations blade in the Intune console: