Skip to main content

Reboot Pending Prompt

Purpose

This solution provides an automated, user-friendly mechanism to handle pending reboots on Windows Workstations within NinjaOne. It addresses the challenge of enforcing critical updates while respecting user productivity by offering a branded, interactive GUI prompt that allows users to defer reboots up to a configurable limit.

The solution operates by detecting pending reboot states triggers (Registry keys, System Uptime, or Manual Overrides) and launching a GUI utility in the active user's session (bypassing Session 0 limitations). It supports a "Warning" phase where deferrals are allowed, and a "Final" phase where a reboot is enforced after a grace period.

Key capabilities include:

  • Interactive User Prompts: Displays a customizable GUI window allowing users to "Yes" (Reboot Now) or "No" (Defer).
  • Deferral Enforcement: Administrators can set a maximum number of prompts. Once exhausted, the system transitions to a mandatory reboot workflow.
  • Smart Detection: Triggers based on Windows Registry keys (CBS/Windows Update), configurable Uptime thresholds, or admin-initiated manual overrides.
  • Branding & Customization: Supports custom window titles, messages, header images, icon images, and dark/light themes to match organizational branding.
  • Productivity Protections: Includes "Quiet Hours" to suppress prompts during specific times (e.g., overnight) and options to skip prompts on weekends.
  • Unattended Handling: Configurable logic to immediately reboot machines if no user is currently logged in.

Note on Dependencies: To ensure the modern GUI functions correctly and securely across all supported Windows versions, this solution automatically manages its own dependencies. Specifically, if the .NET Desktop Runtime 8.0 is missing from a target machine, the solution will silently download and install it during the first run. This ensures the interactive prompt displays correctly without requiring manual prerequisite deployment.

The solution uses a Detection script to evaluate system state and prompt eligibility, which triggers an Autofix script via a Compound Condition to handle the user interaction and reboot logic.

Associated Content

Custom Fields

NameDefaultExampleLevelRequiredManaged By
cPVAL Pending RebootFalseTrueDeviceNoManual / Script
cPVAL Last Prompted-2024-05-20 14:30:00DeviceNoScript (Auto)
cPVAL Times Prompted-2DeviceNoScript (Auto)
cPVAL Reboot Prompt When Pending Reboot-EnableOrg, Loc, DevNoManual
cPVAL Reboot Prompt Uptime Days-14Org, Loc, DevNoManual
cPVAL Reboot Prompt Count45Org, Loc, DevNoManual
cPVAL Reboot Prompt Duration Between Prompt42Org, Loc, DevNoManual
cPVAL Reboot Prompt TitleUpdates Installed...IT Dept: Action ReqOrg, Loc, DevNoManual
cPVAL Reboot Prompt MessageAn 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.
Org, Loc, DevNoManual
cPVAL Reboot Prompt Timeout30060Org, Loc, DevNoManual
cPVAL Final Prompt MessageAn 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.
Org, Loc, DevNoManual
cPVAL Final Prompt Timeout900120Org, Loc, DevNoManual
cPVAL Final Prompt Reboot Delay Minutes510Org, Loc, DevNoManual
cPVAL Reboot Prompt Header Image-https://site.com/logo.pngOrg, Loc, DevNoManual
cPVAL Reboot Prompt Icon Image-C:\Logos\icon.icoOrg, Loc, DevNoManual
cPVAL Reboot Prompt ThemeDarkLightOrg, Loc, DevNoManual
cPVAL Reboot Prompt Skip WeekendsDisableEnableOrg, Loc, DevNoManual
cPVAL Reboot Prompt Suppress Time Window-1800-0900Org, Loc, DevNoManual
cPVAL Reboot if Not Logged InDisableEnableOrg, Loc, DevNoManual

Automations

NameFunction
Reboot Pending Prompt - DetectionDetermines if a machine requires a reboot (Registry, Uptime, or Manual) and if current conditions (Quiet hours, Weekends, User active) allow for a prompt. Returns a specific exit code to trigger the Autofix.
Reboot Pending Prompt - AutofixDownloads the Prompter.exe GUI utility and launches it in the user's active session. Handles user interaction (Deferral vs. Forced) and updates the state-tracking Custom Fields.

Compound Conditions

NameFunction
Reboot Pending Prompt - Windows WorkstationAutomatically runs the Reboot Pending Prompt - Autofix automation when the Detection script identifies that a reboot is pending and a user prompt is required.

Implementation

Step 1

Create the following custom fields as described in the document:

Step 2

Create the following automations as described in the document:

Step 3

Create the following compound conditions as described in the document:

Here are the FAQs for the Reboot Pending Prompt solution. I have written them in simple, clear language to ensure anyone can understand how to configure and use the solution, while covering all technical aspects.

FAQs

Q. What does the Reboot Pending Prompt solution actually do?

A: It helps you get Windows computers to restart when they need to (like after updates), but it asks the user nicely first. Instead of just forcing a restart while someone is working, it shows a popup window asking if they want to reboot now or later. You can control how many times they can say "later" before they have to restart. See the Solution: Reboot Pending Prompt overview for more.

Q. How does the system know when a computer needs a reboot?

A: The system checks three things automatically:

  1. Windows Registry: It looks for specific "flags" that Windows sets when updates are waiting for a restart.
  2. Uptime: It checks how long the computer has been running without a restart. You set this limit in cPVAL Reboot Prompt Uptime Days.
  3. Manual Override: You can force it to think a reboot is needed by checking the cPVAL Pending Reboot box.

Q. Can I force a reboot prompt even if Windows doesn't say it needs one?

A: Yes! If you want to force a prompt cycle on a specific machine for any reason, simply check the box for cPVAL Pending Reboot. The detection script will see this and start the prompting process immediately.

Q. How many times can a user say "No" to the reboot?

A: You decide! By default, they can snooze it 4 times. You can change this number by editing the cPVAL Reboot Prompt Count field. For example, if you set it to 2, they get two warnings, and the third prompt will be the final one.

Q. What happens when the user runs out of "Snoozes"?

A: Once the cPVAL Times Prompted hits the limit you set, the next prompt will be the Final Prompt. This window does not have a "No" button—only an "OK" button. It tells them the computer will restart soon, giving them time to save their work.

Q. How long do they have to save their work during the Final Prompt?

A: After they click "OK" on the final prompt (or if it times out), the computer waits for a grace period before restarting. The default is 5 minutes. You can make this longer or shorter using cPVAL Final Prompt Reboot Delay Minutes.

Q. What if the user ignores the prompt and walks away?

A: The prompt has a timer!

  • Warning Prompts: If the timer runs out (Default: 5 mins), it assumes the user is busy or away. It counts as a "Snooze" (deferral) and closes the window so it doesn't block the screen. Change this duration in cPVAL Reboot Prompt Timeout.
  • Final Prompt: If the timer runs out here (Default: 15 mins), it assumes the user isn't there, and it forces the reboot to ensure the machine gets patched. Change this in cPVAL Final Prompt Timeout.

Q. I don't want to bother users at night. Can I stop the prompts?

A: Yes. You can set a "Quiet Window" using cPVAL Reboot Prompt Suppress Time Window. For example, entering 1800-0900 tells the system: "Do not show any prompts between 6:00 PM and 9:00 AM."

Q. Can I stop the prompts from happening on weekends?

A: Yes. Just set the cPVAL Reboot Prompt Skip Weekends dropdown to Enable. The system will wait until Monday to ask for a reboot.

Q. What happens if nobody is logged into the computer?

A: If the computer is sitting at the login screen (no user is signed in), you can tell the system to just reboot immediately without waiting for a prompt. To do this, set cPVAL Reboot if Not Logged In to Enable.

Q. Can I customize the message the user sees?

A: Absolutely. You can write your own friendly message in cPVAL Reboot Prompt Message.

  • Note: Keep it simple! The script automatically adds the "Would you like to restart?" question and the "You have X attempts remaining" text to the end of whatever you write.

Q. Can I customize the "Final Warning" message separately?

A: Yes. You can set a specific, more urgent message for the last step using cPVAL Final Prompt Message.

  • Note: The script automatically adds the "Your computer will restart in X minutes" text to the end of your message.

Q. Can I use quotation marks in the cPVAL Reboot Prompt Message or cPVAL Final Prompt Message?

A: Yes, but avoid single quotes (') in these fields. The automation scripts embed your message into single-quoted PowerShell strings; an unescaped single quote will break parsing and can stop the prompt from working. If you need to include quotes, use double quotes (") instead.

Example:

  • Good: Security patches installed. "Please save your work before the restart."
  • Avoid: Security patches installed. It's ready for restart. (contains a single quote)

If you must include a single quote, escape it properly in the source that writes the custom field, but preferring double quotes is simpler and safer.

Q. How do I add my company logo to the prompt?

A: You can add a header image (top of the window) or an icon (top left corner).

  1. Upload your image to a public URL (like your website) or copy it to a local folder on every machine.
  2. Paste the URL or file path into cPVAL Reboot Prompt Header Image or cPVAL Reboot Prompt Icon Image.

Q. Does the prompt look okay in Dark Mode?

A: Yes! You can choose the theme. By default, it uses a Dark theme, which looks modern and clean. If you prefer a white background with dark text, set cPVAL Reboot Prompt Theme to Light.

Q. How often does the prompt pop up?

A: If the user clicks "No," the system waits a few hours before asking again so it doesn't spam them. The default wait time is 4 hours. You can change this gap using cPVAL Reboot Prompt Duration Between Prompt.

Q. Can I set these settings for the whole company at once?

A: Yes. All the settings (like cPVAL Reboot Prompt Count or cPVAL Reboot Prompt Title) can be set at the Organization level in NinjaOne.

Q. Can I have different settings for just one Location or Device?

A: Yes. The system checks the Device first, then the Location, then the Organization. This means if you set a special message on one specific computer, that computer will use the special message, and everyone else will use the company default.

Q. Does this work on Servers?

A: This solution is designed for Windows Workstations (Windows 10/11). Servers usually have strict maintenance windows, so prompting a logged-in admin is rarely the desired behavior. The scripts have checks to ensure they run on the correct OS.

Q. Does this work on Macs?

A: No, this specific solution is built using PowerShell and Windows forms, so it only works on Windows computers.

Q. Should I run the "Detection" script manually?

A: No. The Reboot Pending Prompt - Detection script is meant to run automatically as a "Condition" in your NinjaOne policy. It runs silently in the background to check if a reboot is needed.

Q. Should I run the "Autofix" script manually?

A: No. The Reboot Pending Prompt - Autofix script expects to be triggered by the Detection script. It relies on specific logic to calculate how many prompts are left. Running it manually might not work as expected or could trigger a prompt when one isn't needed.

Here is the updated FAQ answer with the requested point clarified to explain that the prompt waits for the user to return to the screen.

Q. Why is the prompt not showing up on my computer?

A: There could be a few reasons:

  1. Not Needed: The computer might not actually need a reboot (check cPVAL Pending Reboot is false).
  2. Too Soon: You might have clicked "No" recently. Check cPVAL Last Prompted to see when the last prompt was.
  3. Quiet Time: It might be night time or the weekend (check cPVAL Reboot Prompt Suppress Time Window).
  4. User Away (Locked/Screensaver): If the computer is locked or the screensaver is running, the system knows a user is logged in but is not currently looking at the screen. It blocks the prompt to ensure the user doesn't miss it or come back to a timer that has already run out. It will retry when the user unlocks the machine.

Q. How do I see how many times a specific user has been prompted?

A: Look at the cPVAL Times Prompted field on their device in NinjaOne. It counts up every time they click "No."

Q. How do I reset the counter for a device?

A: The script does this automatically when the computer finally reboots! You don't need to do it manually. However, if you really want to, you can edit the cPVAL Times Prompted field and set it back to 0.

Q. Can I disable the Uptime check?

A: Yes. If you don't care about uptime and only want to prompt for Windows Updates, set cPVAL Reboot Prompt Uptime Days to 0.

Q. What if I don't want to check the Registry for pending reboots?

A: You can disable the registry check by changing cPVAL Reboot Prompt When Pending Reboot to Disable. Then it will only prompt based on uptime or manual overrides.

Q. Where does the popup window application come from?

A: The script automatically downloads a small, safe utility called Prompter.exe from ProVal's repository. It saves it to a temporary folder on the computer, runs it to show the window.

Q. Why does the script use a Scheduled Task?

A: NinjaOne scripts run in the "System" background (Session 0), which can't show windows to users. To get around this, the script creates a temporary Scheduled Task that says "Hey Windows, please show this window to the user currently logged in!" This makes sure the user actually sees the prompt.

Q. Can I change the title of the window?

A: Yes. The default title is "Updates Installed - Reboot Required", but you can change it to anything (like "IT Department Message") using cPVAL Reboot Prompt Title.

Q. What is the default setup if I don't change anything?

A: By default:

  • Frequency: It asks the user 4 times (every 4 hours).
  • Forced Reboot: It waits 5 minutes before force rebooting on the final prompt.
  • Theme: It uses a Dark Theme.
  • Title: "Updates Installed - Reboot Required"
  • 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."
  • Final 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."

Q. I manually rebooted the computer, but the fields didn't reset. Why?

A: The fields update the next time the Detection script runs. After a reboot, the Detection script will run, see that the computer uptime is low and no registry keys are set, and it will automatically clear cPVAL Pending Reboot and reset the counters for you.

Here are the additional FAQs covering the enablement logic and integration with other solutions.

Q. Is this solution enabled automatically for all my devices?

A: No. The solution is opt-in to prevent unexpected interruptions. You must explicitly enable it by configuring at least one of the trigger fields at the Organization, Location, or Device level:

  1. Registry Check: Set cPVAL Reboot Prompt When Pending Reboot to Enable.
  2. Uptime Check: Set cPVAL Reboot Prompt Uptime Days to a number greater than 0.
  3. Manual Override: Check the cPVAL Pending Reboot box (Device level only).

Q. What happens if another script or solution checks the "cPVAL Pending Reboot" box?

A: That will automatically trigger the reboot prompt cycle! This solution is designed to act as a central reboot manager for your entire NinjaRMM environment.

If a software installation script, a patching automation, or a maintenance task flags the cPVAL Pending Reboot field, this solution takes over. Instead of that other script forcing a hard reboot, this solution detects the flag and gracefully prompts the user according to your defined policy (snoozes, quiet hours, branding, etc.). This ensures a consistent, user-friendly experience regardless of what task initiated the reboot request.

Q. Why is the .NET Desktop Runtime 8.0 being installed on my computers?

A: The graphical utility (Prompter.exe) used to show the popup window is built on modern .NET technology to ensure stability, security, and proper rendering (like Dark Mode support). The script automatically checks if this runtime is present; if it is missing, the script installs it to ensure the prompt works correctly.

Q. Can I use this solution without installing .NET Desktop Runtime 8.0?

A: No. The Prompter.exe application requires the .NET 8.0 Desktop Runtime to launch. Without it, the application would crash, and the user would never see the prompt.

Q. Where does the solution download the .NET installer from?

A: The script downloads the installer directly from official Microsoft servers (download.visualstudio.microsoft.com) to ensure the file is secure and genuine.

Q. Will the installation of .NET 8.0 interrupt the user?

A: No. The installation is performed silently in the background (/quiet and /norestart flags are used). The user will not see an installation window, and it does not force a reboot of its own.

Changelog

2025-12-19

  • Initial version of the document