none
Using a Loop in a Task Sequence RRS feed

  • Question

  • Is There a way to create a loop in an MDT task sequence?

    I want to run a step (update bios) and if the current BIOS cannot installed because an interim bios needs to be installed, I want to apply the Interim bios, then reboot and re-run the same step, which this time would upgrade to the proper bios. Don't know yet wheather I am going to run this step just 1 or 2 times or more, hence not just wanting to repeat the step. The step runs a vbscript to do the test/apply/reboot, so if there is a way to tell MDT to repeat the step or set next step to be the same step, that would be great.

    Sunday, October 5, 2014 7:05 PM

Answers

  • The SCCM Stand Alone Task Sequencer is liner only.

    That being said, a script *can* request for itself to be run again, and request a reboot.

    Simply add the following SMSTS* variables into your VBScript:

    <job id="BIOSCheck">
    	<script language="VBScript" src="ZTIUtility.vbs"/>
    	<script language="VBScript">
    
    Option Explicit
    RunNewInstance
    
    Class BIOSCheck
    
    	Function Main
    
    		If IsBIOSOutOfDate then
    
    			call UpdateBIOSNow
    			oEnvironment.Item("SMSTSRebootRequested") = "true"
    			oEnvironment.Item("SMSTSRetryRequested") = "true"
    			exit function
    		End if
    
    		oLogging.CreateEntry "BIOS should be up to date" , LogTypeInfo
    		Main = SUCCESS
    
    	End Function
    
    End class
    
    	</script>
    </job>
    


    Keith Garner - Principal Consultant [owner] - http://DeploymentLive.com

    Monday, October 6, 2014 12:00 AM
    Moderator

All replies

  • Hi,

    You should inspire yourself on the ZTIWindowsUpdate.wsf script. It is meant to apply updates and will run several times over computer reboot. 


    Mickael,
    My technet galleries contributions :
    ConfigMgr driver injector
    SCCM Collection splitter
    ConfigMgr TS Tools
    Customize WinPE images with powershell

    Sunday, October 5, 2014 7:53 PM
  • The SCCM Stand Alone Task Sequencer is liner only.

    That being said, a script *can* request for itself to be run again, and request a reboot.

    Simply add the following SMSTS* variables into your VBScript:

    <job id="BIOSCheck">
    	<script language="VBScript" src="ZTIUtility.vbs"/>
    	<script language="VBScript">
    
    Option Explicit
    RunNewInstance
    
    Class BIOSCheck
    
    	Function Main
    
    		If IsBIOSOutOfDate then
    
    			call UpdateBIOSNow
    			oEnvironment.Item("SMSTSRebootRequested") = "true"
    			oEnvironment.Item("SMSTSRetryRequested") = "true"
    			exit function
    		End if
    
    		oLogging.CreateEntry "BIOS should be up to date" , LogTypeInfo
    		Main = SUCCESS
    
    	End Function
    
    End class
    
    	</script>
    </job>
    


    Keith Garner - Principal Consultant [owner] - http://DeploymentLive.com

    Monday, October 6, 2014 12:00 AM
    Moderator