Simple reboot window or prompt?

Hey guys!
This should be simple… We’re looking to use the toolkit to simply reboot the computer while giving the users a nice window letting them know the reboot is happening. No apps are being installed and no changes are being made to the computer…we just want to notify users of the reboot.

What’s the best way to do this using the toolkit?

I’ve done the basics in using the following command, but it didn’t work:
Execute-Process C:\Windows\system32\shutdown.exe /r /t 30

So what else are my other options?

Thanks!

have you tried Show-InstallationRestartPrompt?

FYI: There are a few caveats that people fall in all the time:

Help with EXE and shut down commands - The Toolkit / General Discussion - PSAppDeployToolkit Community

So I’ve added the installationRestartPrompt, but nothing happens as we’re not executing any command. I just get the window that says installation starts and completes, but no countdown window ever shows and the computer never reboots.

##*===============================================
		##* POST-INSTALLATION
		##*===============================================
		[string]$installPhase = 'Post-Installation'
		
		## <Perform Post-Installation tasks here>
		
		## Display a message at the end of the install
		Show-InstallationRestartPrompt -Countdownseconds 60 -CountdownNoHideSeconds 30

What is in you Installation section? Did you removed the Zero-Config MSI Installation?

Try this:

Show-InstallationRestartPrompt -Countdownseconds 60 -NoSilentRestart $false

If it works, then you have to set interactive installation in SCCM, or using ServiceUI.exe with Intune, or other settings if you are using other distribution tools.

Ok, so I got the restart prompt window to show up, but there is no countdown or buttons as shown in the example below, so what am I missing?

restartprompt

This is what I have in my template at work:

Show-InstallationRestartPrompt -Countdownseconds 61 -CountdownNoHideSeconds 60 -NoSilentRestart $false

This is what I have for the full Post install task section

## Display a message at the end of the install
		If (-not $useDefaultMsi) { Show-InstallationPrompt -Message 'Your computer will reboot in 5 minutes.  Please save your work.'  -Icon Information }
        Show-InstallationRestartPrompt -Countdownseconds 300 -CountdownNoHideSeconds 299 -NoSilentRestart $false

With this I DO NOT get any buttons that say Restart Later or Restart Now. How do I get those buttons?

Remove the first line

If (-not $useDefaultMsi) { Show-InstallationPrompt -Message 'Your computer will reboot in 5 minutes.  Please save your work.'  -Icon Information }

It’s not exactly what you were asking about, but I use Reboot Dialog to insist that users reboot on my schedule - not when they decide to finally get around to it.

The app is very configurable and may do what you need. While it doesn’t force a reboot, reminding users every 3 minutes should be pretty convincing.

RebootDialog_Screen

1 Like

unfortunately that didn’t help. Now it’s just stuck on the install window, with no buttons anywhere

I’m assuming you are using PSADT v3.8.4.
You could try the 3.8.5 beta.

Another thing you could do is show what the PSADT log file when it gets to the Show-InstallationRestartPrompt line.

Even at that, there isn’t much we can do. It should just work.

So I got it to show the timer and reboot by simply having the line "Show-InstallationRestartPrompt"

But it only defaults to 1 minute. As soon as I add: -Countdownseconds 300 -CountdownNoHideSeconds 299

The timer goes away and no buttons are shown to give the user the option to restart now or later.

Log files show: [Post-Installation] :: Invoking Show-InstallationRestartPrompt asynchronously with a [600] second countdown..

But again, there’s no countdown.

Where can I get my hands on the 3.8.5 beta? Google search doesn’t yield any concrete links.

go to GitHub - PSAppDeployToolkit/PSAppDeployToolkit: Project Homepage & Forums

On the Green button, click on the down arrow and select Download Zip.

There will be extra files. focus on the \PSAppDeployToolkit-master\Toolkit\ folder

The CHANGELOG.txt says it’s 3.8.5.

Any way, it’s what I use.

1 Like

What about something like this:

$DialogText1 = !!!ATTENTION!!!nnYour computer needs to be rebooted. Please press OK to start a 4 hour countdown.nnAt the end of the 4 hours, your computer will be FORCEFULLY rebooted. Be sure to save all of your work!nn
Show-DialogBox -Title ‘Computer Reboot Needed’ -Text $DialogText1 -Icon ‘Information’ -Timeout 1800

Then have SCCM force the reboot?

The 3.8.5 beta version fixed the issue. All good now. Thanks!

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.