how to create a task sequence in sccm 2012
Hello All, My name is Vishal Goyel, and this is my first post on this blog. I worked for several years as a Microsoft support engineer specialized in SCCM Task Sequence and OSD. In this post, you will learn step by step description of the SCCM OSD Task Sequence.
Introduction SCCM OSD Task Sequence
The OSD is the most widely used feature of ConfigMgr (SCCM). When it comes to troubleshooting OSD related issues, there is only one file SMSTS.log that can help us. However, the SMSTS.log file contains a lot of redundant information. To troubleshoot OSD related problems, learning to read SMSTS.log is very important.
Following are the main output which you are going to get out of this ultimate guide.
- Learn how to understand SCCM OSD Task Sequence Steps & Process
- Learn how to read SMSTS.log effectively
- Learn how to troubleshoot SCCM OSD Task Sequence
Basic SCCM OSD Task Sequence Structure
In this post, I will be explaining all the steps in a basic Task Sequence and how to read SMSTS.log.
-
Basic Task Sequence – How to Create SCCM Task Sequence
WinPE & PXE Boot Stage – SCCM OSD Task Sequence
Machine boots into WinPE and download the Boot Image. Once WinPE is initialized, you can find SMSTS.log in below location.
X:\Windows\Temp\SMSTSLOG\SMSTS.log
If you check the logs, at the very beginning, it will show the Boot Image files that it downloaded.
RAM Disk Boot Path: NET(0)\SMSIMAGES\LAB00005\BOOT.LAB00005.WIM TSBootShell
Booted from network (PXE) TSBootShell
-
SMSTS.log How to Create SCCM Task Sequence Step by Step Guide
You can confirm from the logs if machine PXE booted or it booted using any media.
Download Variable Files
The first thing that machine does is to Download variable files from WDS server from RemoteInstall\SMSTemp\ folder and stores it as Variable.dat file locally on X drive under X:\SMS\Data folder.
Device has PXE booted TSPxe
Variable Path: \SMSTemp\2017.03.16.13.41.39.0002.{F4304B8E-9855-401C-8168-D6BAF045258A}.boot.var TSPxe
-
Device has PXE Booted – How to Create SCCM Task Sequence Step by Step Guide
NIC Card is Initialized – SCCM MP Communication
Once variable files are downloaded, NIC card is initialized on the machine, and we can see IP Address assigned to the machine in the logs (shown below).
Loading Media Variables from "X:\sms\data\variables.dat" TSPxe
Found network adapter "Intel 21140-Based PCI Fast Ethernet Adapter (Emulated)" with IP Address 192.168.1.32 TSPxe
-
Found network adapter – How to Create SCCM Task Sequence Step by Step Guide
Time Zone Update
Then the SCCM TS engine updates the Time information on the client machine.
Time zone: 480,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, TSPxe
.
.
New time: 2017-03-04 21:11:20:246 TSPxe
Current time: 2017-03-04 21:11:20.238 TZ: Bias:-0480
Connects with SCCM MP
The Machine then makes a connection with Management Point to download the base policies deployed to the machine.
CLibSMSMessageWinHttpTransport::Send: URL: PR2LAB.lab.in:80 GET /SMS_MP/.sms_aut?MPKEYINFORMATIONMEDIA
Request was succesful.
New MP settings: TSPxe
site=01P,01P, MP=http://PR2LAb.lab.in, ports: http=80,https=443 TSPxe
certificates are received from MP. TSPxe
Unknown machine GUIDs: d1c4c682-cf2d-4245-af8d-20e9773f5f2d 0a156af7-e87d-4242-aa58-b3414486bd1c TSPxe
Downloading policy from http://PR2LAb.lab.in TSPxe
Initializing HTTP transport. TSPxe
.
.
.
Setting SMBIOS GUID = 7E25FE8F-F341-11E1-A20A-6C8447038046. TSPxe
Adding MAC Address A0:B3:CC:28:14:B7. TSPxe
-
New MP settings – How to Create SCCM Task Sequence Step by Step Guide
Retrieving Policy Assignment from SCCM MP
-
Retrieving Policy Assignment – How to Create SCCM Task Sequence Step by Step Guide
List of Available SCCM OSD Task Sequence
Once NIC Card is initialized, and communication with Management Point is established, we can see list of deployed Task Sequences on the machine as shown below.
-
Select a Task Sequence to run – How to Create SCCM Task Sequence Step by Step Guide
Policy Download & Resolving Dependencies
Once we select any specific Task Sequence from the above Wizard, machine downloads the policy for the same and proceed with resolving dependencies for all the content associated in the task sequence.
Downloading policy body LAB20000-PR100003-6F6BCC28. TSPxe
Preparing Policy Body Request. TSPxe
Setting transport. TSPxe
Setting policy location = http:///SMS_MP/.sms_pol?LAB20000-PR100003-6F6BCC28.1_00. TSPxe
Executing Policy Body Request. TSPxe
Using Authenticator for policy TSPxe
CLibSMSMessageWinHttpTransport::Send: URL: servername.fqdn.local:888 GET /SMS_MP/.sms_pol?LAB20000-PR100003-6F6BCC28.1_00 TSPxe
-
Downloading policy body How to Create SCCM Task Sequence Step by Step Guide
Parsing Policy Body.......
Source version for package......
Getting network access account......
-
Network Access Account – How to Create SCCM Task Sequence Step by Step Guide
Download SCCM OSD Task Sequence Content
Before SCCM Task Sequence execution starts, machine resolves the dependencies, which means, it checks for the Content Location for each package associated with the Task Sequence.
It will proceed with SCCM Task Sequence only if it can receive at least one content location for each package.
If it is not able to find any of the packages on the Distribution Points, it will fail to resolve the dependencies this is mostly due to Boundary issues or package distribution issues. (Content location for one package is shown below).
-
Found Location
Launch TSManager.EXE
Once the dependencies are resolved, it invokes TSManager.exe that drives the entire Task Sequence.
-
Set Command Line – SCCM Task Sequence
The first thing that TSManager does if to parse all the steps in the Task Sequence. It reads through each step and checks the associated conditions with every step.
-
Initializing TS Engine
-
SMS TS Variable – SCCM TS Guide
Once it is done with parsing the Task Sequence, it starts with TS execution.
We can see that is it starting the execution of the First step that is Partition Disk 0 -BIOS.
Before is executes the step, it evaluates conditions attached with the step, if any as shown below.
-
The Variable Condition Expression – SCCM OSD Task Sequence
OSD Diskpart
The OSDDiskpart.exe which is injected into the Boot Image once we update the boot image on Distribution Point takes care of Disk Partitioning and based on the settings in the step, it creates the disk partitions.
-
Executing Diskpart Script – SCCM TS Step by Step Guide
Apply the Operating System Image
After partitioning the disk, it proceeds with the next step that is to Apply the Operating System image using SCCM OSD Task Sequence.
The OSDApplyOS.exe takes care of applying the OS to the Primary Partition.
-
OSDApplyOS.EXE – SCCM TS Guide
Download OS WIM File
Before it can apply the OS, it need to download the OS WIM file; we can see from below screenshot that it is working on downloading the WIM file from the Distribution Point. It uses the Network Access Account(NAA) to download the file.
-
DownloadOnDemand Flag is True SCCM TS
Wipes Primary Partition
Once, the image file is downloaded to C:\_SMSTaskSequence\Packages folder, before applying the OS, it again wipes the Primary Partition where it is designed to skip certain folder including C:\_SMSTaskSequence where all the contents are downloaded during the imaging process.
-
Content Successfully Downloaded for Task Sequence
It then copies the Boot files to root of drive and BCD is written.
-
System root for Target OS – SCCM Task Sequence is
Additional Windows Configurations
During the process, it saves the initial windows configuration to C:\windows\panther\unattend\unaddend.xml file which will contain all the settings and will be executed at later point of time when machine boot into Full OS for the first time.
-
Writing Configuration Information
Then it proceeds with Apply Windows Settings step.
The OSDWinSettings.exe takes care of this process.
-
Start Executing an Instruction – SCCM Task Sequence Guide
It loads the Unattend.xml and appends it with the settings that we have specified in the Task Sequence step for Apply Windows Settings.
-
Loading Existing Answer File – SCCM
Apply Network Settings
The next step that it runs is Apply Network Settings, OSDNetSettings.exe takes care of this process.
-
Network Settings – OSDNetSettings.exe
During this step as well, it appends Unattend.XML file with the specified settings.
NOTE!: Settings specified in Apply Windows and Network settings, are not "actually" applied on the machine when these steps are executed, the information is read from Task Sequence step and written to Unattend.XML. We can find the file under C:\Windows\Panther\Unattend folder.
Unattend.XML Injection
I am adding the sample Unattend.XML file; we can see that settings for Time Zone, Local Admin Password, Computer Name, and Domain join are written to the below file.
-
Unattend.XML SCCM OSD Task Sequence
Windows and SCCM Client Setup
It now proceeds with Setup Windows and Configuration Manager step. During this step, the client agent files are downloaded to the machine, and Boot Manager is updated to Boot into Full OS which we just installed at the Apply Operating System Step. OSDSetupWindows.exe drives this process.
-
SCCM OSD TS Setup Windows Configuration Manager step
We can see that it is downloading the Client Agent files locally to the machine.
-
Download SCCM Client During OSD TS
Reboot to Come Out of WinPE
Now, the machine needs to reboot so that I can come out of WinPE and boot into the Full OS. Before machine reboots, it creates SetupComplete.CMD file under C:\Windows\Setup\Scripts folder. If we check this file, we will see the following line:
%windir%\system32\osdsetuphook.exe /execute
The SetupComplete.CMD file is a Windows Setup file which is executed once Windows Setup completes. Due to this file, Task Sequence continues to run after the boot and booting into the Full OS.
-
SetupComplete.CMD – SCCM OSD Task Sequence
We can see that before Rebooting into WinPE, Setup Windows and Configuration Manager step, requests for a retry.
During this reboot, Windows and Network Settings are executed from Unattend.XML file that was created earlier.
Once it has applied the settings, it deletes this file as it contains the Domain Join account and Local Admin Account password in plain text.
Loading the Registry hives, applying the drivers, setup of the entire OS is done during this phase.
-
Expand a String SCCM OSD TS
Conclusion SCCM OSD Task Sequence
After the reboot, once Task Sequence is resumed, it completes the Configuration Manager client and continues with further steps like Application Installation or Software Update installation if any.
It finally moves the SMSTS.log to C:\Windows\CCM\Logs folder. Once the installation is completed successfully, it deletes C:\_SMSTaskSeuquence folder.
Bonus Tip
Have yo upgraded to SCCM 1902 version yet? Have you started using PowerShell Scripts without package or content?
If so, here is the tip bonus tip to find out the location where the PowerShell script must be stored in the Windows 10 client machine.
X:\Windows\Temp\SMSTSPowerShellScripts
Resources
- Windows 10 OSD Best Practices with SCCM
- Task sequence steps in Configuration Manager
how to create a task sequence in sccm 2012
Source: https://www.anoopcnair.com/sccm-osd-task-sequence-ultimate-guide/
Posted by: myersounfee.blogspot.com

0 Response to "how to create a task sequence in sccm 2012"
Post a Comment