Restart Device

Overview

Tests if a restart is necessary due to too long device uptime, or pending patch installation, and based on provided input configures restart of the target device. The campaign is displayed to enable user immediate restart or postpone until the next script execution. After the restart, previously opened user's applications are restored.

Input parameters

ParameterDescriptionValue

TestPendingRestart

Controls if the script should verify if the device is pending restart due to recently installed patch. A positive result will lead to trying to restart the device following the options selected on the other inputs.

  • Valid values: True/False

  • Default: True

CampaignId

Campaign GUID asking the end-user for restart. The end-user needs to respond NOW to trigger the restart. If not, the restart is postponed.

  • Empty string ("") or empty GUID (00000000-0000-0000-0000-000000000000) are valid values only if ShowCampaign input is filled with "Never".

  • Default: 4fc67441-e4e3-4905-b533-620eb4083c2b

ShowCampaign

Determines circumstances the campaign is displayed to the end-user. The campaign will give the end-user the option to postpone the restart or execute it

now.

  • Valid values are:

    • Always: Campaign is displayed to end-user at every remote action execution and device restart is never forced.

    • DuringGracePeriod: End-user will have a limited time to postpone device restart. When the grace period expires, a forced restart is executed. The length of the grace period is provided in PostponeGracePeriodInDays input parameter.

    • OnlyFirstExecution: End-user is notified via the campaign only the first time the remote action is executed. When the remote action is executed a second time the restart will be forced.

    • Never: The end-user is never asked. The restart is always force.

  • Default: Always

NumberOfDaysSinceLastReboot

Maximum number of days allowed for the device to be running without a restart. A day is 24 hours therefore, forced restart is triggered only if the remote action detects that end-user postponed restarting more than 24 hours ago.

  • Range: 1-60.

  • Default: 30

PostponeGracePeriodInDays

Maximum number of days that end-user can postpone restart when ShowCampaign is DuringGracePeriod.

This input will only take effect if the remote action is executed more than once.

  • Range: 1-30.

  • Default: 7

RestartDelayInSeconds

Delay time between initiating restart and it's execution if restart conditions have been met.

  • Range: 45-86400.

  • Default: 300

Recommendations

Recommended timeout: 720 Recommended way of use: Schedule the remote action to be executed once per day.

IMPORTANT: If you don't execute the RA periodically, PostponeGracePeriodInDays won't work as designed.

Common use cases

I want to keep the company devices restarted at least once each 15 days but I don't want to do it without the consent of the end-user

Recommended Inputs

  • TestPendingRestart: false

  • CampaignId: 4fc67441-e4e3-4905-b533-620eb4083c2b

  • ShowCampaign: Always

  • NumberOfDaysSinceLastReboot: 15

  • PostponeGracePeriodInDays: 7 (this value won't affect the execution but needs to be an integer between 1 and 30)

  • RestartDelayInSeconds: 300

I want to enforce that the company devices have the latest Windows patch or restart devices that have been running more than 30 days. I want to let the end-user 3 days to restart in their own terms but if they don't, force the restart either way.

Recommended Inputs

  • TestPendingRestart: true

  • CampaignId: 4fc67441-e4e3-4905-b533-620eb4083c2b

  • ShowCampaign: DuringGracePeriod

  • NumberOfDaysSinceLastReboot: 30

  • PostponeGracePeriodInDays: 3

  • RestartDelayInSeconds: 300

I want the company devices to be restarted when their uptime is bigger than a week or when they have pending Windows patches. I want to ask one time but if they ignore the notification, the restart should be forced.

Recommended Inputs

  • TestPendingRestart: true

  • CampaignId: 4fc67441-e4e3-4905-b533-620eb4083c2b

  • ShowCampaign: OnlyFirstExecution

  • NumberOfDaysSinceLastReboot: 7

  • PostponeGracePeriodInDays: 7 (this value won't affect the execution but needs to be an integer between 1 and 30)

  • RestartDelayInSeconds: 300

Other values

End-user execution: Current interactive user

Compatibility: Windows 10 and Windows 7

Last updated