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 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
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.
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?
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.
$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