tip on how to prompt for restart when using get-pendingreboot

//tip on how to prompt for restart when using get-pendingreboot
tip on how to prompt for restart when using get-pendingreboot 2017-08-07T17:54:58+00:00

The Toolkit Forums General tip on how to prompt for restart when using get-pendingreboot

  • Author
    Posts
  • Roger
    Participant
    Post count: 4
    #2219 |

    I have been using the get-pendingreboot option for a while, before it was incorporated in the main script I used it as an extension using a script from Microsoft.

    Works well too and gives users 8 hours before it reboots:

    If($IsSystemRebootPending -eq $True){
    Show-InstallationRestartPrompt -CountdownSeconds 28805 -CountdownNoHideSeconds 60
    Exit-Script -ExitCode 1618
    }

    You could either simply add this to your deploy scripts or at the end of the get-pendingreboot function (what I have been doing).

    • This topic was modified 3 months, 2 weeks ago by  Roger.
  • Francois
    Participant
    Post count: 101

    Hi,

    But it will not work with SCCM as Show-InstallationRestartPrompt will not show up while deploying with System account (session 0).

    Thanks,

  • Craig
    Participant
    Post count: 1

    Hi guys,

    I’m unable to get this code to work on Windows 7 (powershell version 2.0). The IsSystemRebootPending value is true but is not prompting to restart with your code?

    I intend to deploy to a targeted collection in ConfigMgr, although the script is not manually working.

    Any help would be great

    Regards,
    Craig

You must be logged in to reply to this topic.