Automatically reboo...
 

Automatically reboot/restart SCCM Task Sequence as last step using "SMSTSPostAction"  

  RSS

Marco Nuijens
(@manu)
Member Admin
Joined: 3 years ago
Posts: 50
20/01/2017 12:33 pm  

In some cases it comes in handy to restart or shutdown your task sequence (TS) at the end of the TS. A downside of giving a shutdown or restart command at the end of a TS is that SCCM will not log the TS as finished until the last task is peformed succesfully. This is the moment where "SMSTSPostAction" comes in place.

"SMSTSPostAction" is a TS variable which you can set at the end of a TS with a certain value/command. It will perform this action when the end of the TS is reached and the TS has finished succesfully.

At this moment I mostly use this variable for performing the last reboot for the device which is deployed. But you can also choose to shutdown the machine if you prefer that. Underneath a example how I use this at the moment.

Underneath some value's / commands which can be usefull to perform at the end of a TS using this variable.

  • :: Restart device:
    cmd /c shutdown /r /t 0 /f
    
    :: Shutdown devic:
    cmd /c shutdown /s /t 0 /f
    
    :: Group Policy update with a reboot:
    gpupdate /force /boot
    
    :: Run a specific script:
    C:temp<filename>.<extension>

     

 


Quote
Matthijs F
 Matthijs F
(@Matthijs F)
Guest
Joined: 2 years ago
Posts: 1
02/11/2017 12:49 pm  

:: Run a specific script:
C:/temp/.

Shouldn't those be backslashes?


ReplyQuote
Marco Nuijens
(@manu)
Member Admin
Joined: 3 years ago
Posts: 50
28/11/2017 10:42 am  

Yes they should, adjusted the script, thank you!


ReplyQuote
David Jirousek
 David Jirousek
(@David Jirousek)
Guest
Joined: 6 months ago
Posts: 1
08/03/2019 7:10 pm  

Keep in mind that the command "gpupdate.exe /Force /Boot" may not always produce the desired Reboot. "/Boot - This option has no effect if there are no extensions called that require a restart." What may only occur is a forced logoff.


ReplyQuote
Share:
  
Working

Please Login or Register