Reboot and wait

To test I created three Tasks with the following ActionScripts:

  • TaskSequenceTest1:
delete __appendfile
appendfile I did thing one at {now}
appendfile Boot time was {boot time of operating system}
appendfile System uptime is {uptime of operating system}

delete c:\temp\thing1.txt
move __appendfile c:\temp\thing1.txt
  • TaskSequenceRebootAndWait:
// when using the 'restart' actionscript command, *must* specify a time 
//   or it will wait until the user acknowledges a reboot message.
restart 60
  • TaskSequenceTest2:
delete __appendfile
appendfile I did thing two at {now}
appendfile Boot time was {boot time of operating system}
appendfile System uptime is {uptime of operating system}

delete c:\temp\thing2.txt
move __appendfile c:\temp\thing2.txt

Add all three tasks to a Baseline and configure the order, so the reboot task comes between the other two…

Action the Baseline to the client.

Before Reboot on client:

After reboot on client:

We can see from the text files on the client that both Tasks were executed and there was a reboot between them:

PS C:\temp> type thing1.txt
I did thing one at Wed, 03 Apr 2024 06:39:46 -0700
Boot time was Mon, 26 Feb 2024 08:32:09 -0700
System uptime is 34 days, 18:38:40.625
PS C:\temp>
PS C:\temp> type thing2.txt
I did thing two at Wed, 03 Apr 2024 06:43:31 -0700
Boot time was Wed, 03 Apr 2024 06:41:15 -0700
System uptime is 00:02:15.250

While client was rebooting, after Task 1:

After client rebooted, after running Task 2:

Hope this helps!

2 Likes