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.
Detection
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.
Remediation
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:
Note: Microsoft may be soon changing the location for Proactive Remediations within Intune.
Click "Create script package"
Enter Name and Description
Upload detection and remediation scripts
Be sure to set "Run this script using the logged-on credentials" and "Run script in 64-bit PowerShell" to "Yes".
Set any scope tags as needed
Assign the Proactive Remediation
Caution: Include or Exclude either device groups or user groups. Do not mix user and device groups across, include and excluding assignments. This can cause unexpected behavior.
Confirm and click Create
This remediation will be a gentle nudge for users to periodically reboot their devices and will hopefully improve Windows Update metrics among other things.
> Jorgeasaurus
Subscribe to > Jorgeasaurus
Don’t miss out on the latest issues. Sign up now to get access to the library of members-only issues.