Reboot Pending Prompt - Autofix
Overview
This script acts as the remediation (Autofix) component of the "Reboot Pending Prompt" solution. It is triggered automatically when the Detection script determines that a reboot is necessary and conditions are right to interrupt the user.
Since RMM scripts run in the background (Session 0) and cannot normally show windows to the user, this script utilizes a temporary Scheduled Task to bypass this limitation. It launches a branded GUI utility (Prompter.exe) inside the active user's session. Depending on how many times the user has already postponed the reboot, the script will either present a "Yes/No" deferral option or a "Final Warning" that enforces the reboot after a few minutes.
Sample Run
Note:
- It is not recommended to run this script manually. The script is designed for the Autofix script of Reboot Pending Prompt - Windows Workstation compound condition.
- Prompter requires '.NET Desktop Runtime 8.0' to run. If missing, the script automatically downloads and installs it silently.
Dependencies
- Custom Field: cPVAL Pending Reboot
- Custom Field: cPVAL Last Prompted
- Custom Field: cPVAL Times Prompted
- Custom Field: cPVAL Reboot Prompt Count
- Custom Field: cPVAL Reboot Prompt Duration Between Prompt
- Custom Field: cPVAL Reboot Prompt Title
- Custom Field: cPVAL Reboot Prompt Message
- Custom Field: cPVAL Reboot Prompt Timeout
- Custom Field: cPVAL Final Prompt Message
- Custom Field: cPVAL Final Prompt Timeout
- Custom Field: cPVAL Final Prompt Reboot Delay Minutes
- Custom Field: cPVAL Reboot Prompt Header Image
- Custom Field: cPVAL Reboot Prompt Icon Image
- Custom Field: cPVAL Reboot Prompt Theme
- Custom Field: cPVAL Reboot if Not Logged In
- Application: Prompter
- Automation: Reboot Pending Prompt - Detection
- Solution: Reboot Pending Prompt
Custom Fields
| Custom Field | Default | Example | Description |
|---|---|---|---|
| cPVAL Reboot Prompt Count | 4 | 5 | Max deferrals allowed before a forced reboot. |
| cPVAL Reboot Prompt Duration Between Prompt | 4 | 2 | Minimum hours to wait between prompts. Used for message display text only in this script. |
| cPVAL Reboot Prompt Title | Updates Installed - Reboot Required | IT Dept: Important Updates | Title of the GUI window. |
| cPVAL Reboot Prompt Message | An update has been installed on your computer. Would you like to restart now to complete the installation of updates? You have {X} prompt(s) remaining before a forced reboot. Next prompt will be sent in {Y} hours. | We installed security patches.Resulting Prompt: We installed security patches. Would you like to restart now? You have {X} prompt(s) remaining before a forced reboot. | Custom message body. The script automatically appends the question and remaining count to whatever text you provide. Avoid using single quotation marks (') in the message. Use regular quotes (") if needed. |
| cPVAL Final Prompt Message | An update has been installed on your computer. This is the final prompt before your computer will automatically restart to complete the installation of updates. Please save your work. Your computer will be restarted after {X} minute(s) after you acknowledge this prompt. | Deferrals exhausted.Resulting Prompt: Deferrals exhausted. This is the final prompt before your computer will automatically restart. Your computer will be restarted after {X} minute(s) after you acknowledge this prompt. | Message displayed when no deferrals remain. The script automatically appends the reboot warning and timer to your text. Avoid using single quotation marks (') in the message. Use regular quotes (") if needed. |
| cPVAL Reboot Prompt Timeout | 300 | 60 | Time in seconds before a "Warning" prompt closes automatically (defaults to deferral). |
| cPVAL Final Prompt Timeout | 900 | 120 | Time in seconds before a "Final" prompt closes automatically (defaults to forced reboot). |
| cPVAL Final Prompt Reboot Delay Minutes | 5 | 10 | Grace period (in minutes) after final acknowledgment before the forced reboot occurs. |
| cPVAL Reboot Prompt Header Image | C:\Logos\header.png or https://example.com/logo.png | Local file path or URL for the header image. | |
| cPVAL Reboot Prompt Icon Image | C:\Logos\icon.ico | Local file path or URL for the icon image. | |
| cPVAL Reboot Prompt Theme | Dark | Light | UI Theme: "Dark" or "Light". |
| cPVAL Reboot if Not Logged In | Disable | Enable | Forces reboot immediately if no user session is active. |
| cPVAL Last Prompted | 2024-05-20 14:30:00 | Updated to current timestamp if user defers. Updated by script. | |
| cPVAL Times Prompted | 2 | Incremented by 1 if user defers. Resets to 0 on Reboot. Updated by script. | |
| cPVAL Pending Reboot | False | Set to False upon successful reboot initiation. Updated by script. |
Automation Setup/Import
Output
- Activity Details: Logs the interaction result (e.g., "User declined reboot", "User opted to reboot", or "Final prompt acknowledged").
- Custom Field: Updates
cPVAL Last Promptedand incrementscPVAL Times Promptedif the user defers. Resets all tracking fields if the reboot is initiated. - User Prompt
Sample Prompts
With Default Values:

With Custom Header and Icon Image:
