Last active
July 17, 2019 18:48
-
-
Save Diagg/b159cfdc37b4bf9acfa71ce29afc0d2b to your computer and use it in GitHub Desktop.
This script for MDT/SCCM demonstrate how to reboot to the same Task Séquence step wether you are on WinPE or Windows.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <job id="BIOSCheck"> | |
| <script language="VBScript" src="ZTIUtility.vbs"/> | |
| <script language="VBScript"> | |
| Option Explicit | |
| RunNewInstance | |
| Class TestReboot | |
| Function Main | |
| oLogging.CreateEntry "@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@" , LogTypeInfo | |
| If oEnvironment.Exists("RebootCount") then | |
| oEnvironment.Item("RebootCount") = oEnvironment.Item("RebootCount") + 1 | |
| Else | |
| oEnvironment.Item("RebootCount") = 1 | |
| End If | |
| oLogging.CreateEntry "Preparing to reboot for the " & oEnvironment.Item("RebootCount") & " Time" , LogTypeInfo | |
| oUtility.SafeSleep 15000 | |
| If oEnvironment.Item("RebootCount") <= 3 then | |
| If oEnvironment.Item("OSVersion") = "WinPE" Then | |
| oEnvironment.Item("SMSTSRebootRequested") = "WinPE" | |
| Else | |
| oEnvironment.Item("SMSTSRebootRequested") = "true" | |
| End If | |
| oEnvironment.Item("SMSTSRetryRequested") = "true" | |
| oLogging.CreateEntry "Reboot intitated, quit" , LogTypeInfo | |
| Else | |
| oLogging.CreateEntry "Looping Out of reboot, continuing TS execution!" , LogTypeInfo | |
| End If | |
| oLogging.CreateEntry "@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@" , LogTypeInfo | |
| Main = SUCCESS | |
| End Function | |
| End class | |
| </script> | |
| </job> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment