Friday, April 18, 2014

SCCM task sequence offline media PC shutdown



On my one of the recent project, I have been asked to create an offline media to build machines in two stages.
Stage 1 will be built in a remote location (warehouse) using an USB key and Stage 2 will be on the client network.
In stage 1 the task sequence will deploy all the apps along with all other tasks which does not requires a network connection (in other words anything that takes time to complete). In stage 2 domain join then finalise the task sequence ending steps. The client wants to use only offline media not the staging media.

So I needed to find a way to shut down the machine gracefully after completing the stage one then when the build engineer starts the machine next time it should continue where it was stopped.

I have found 1 or 2 articles on this topic on the net suggesting pull the power cord out while the machine restarting and in post stage (at boot stage). Well, that is not feasible. But that gave me an idea to how to shut down the machine and restart.

How it works;
So first task sequence  will send a shutdown command with 60 seconds time out. Then we will add a Restart step with longer then the shutdown time. So the task sequence will pass shutdown command then move on to the next step which is Restart. In the 60 seconds time, the task sequence will pass restart command to the machine and initiate a system restart. Before the system restart completes, machine will shut down with the first shutdown command. When next time the machine restarts the task sequence will continue from the restart step.
 
How to do;
Create a new group called Shutdown on the task sequence after running the last step. Under Shut down group add a Run Command Line step then add Shutdown /s /t 60
 
Next Add a Restart computer step after the shutdown step.
 Important thing to remember is;
-          Add enough time to shutdown (in shutdown –t X ) the machine properly.
-          Always add extra time in Restart Computer step. If the machine completes Restart step before completing the shutdown process, then the machine will restart instead of shutdown.

That’s it. Now we know how to split the offline media into two stages.
Probably this is not the smartest idea but fits for the purpose.

1 comment:

  1. This is very genius idea :) . and its working very nicely, good job man

    ReplyDelete