Tuesday, October 1, 2013

1.3.2 Rebuild

In rebuild step, the task sequence will back up the data using hardlink method using USMT 4.
Rebuild will be used only to re-build existing machines where they have a proper corporate image previously and where we don’t have to format and re-partition the hard drive.

Create group called Re-Build same level as Migration group. The Re-Build step will be initiated if following conditions are met;

Create a sub folder State Store Re-Build under Re-Build then add Use Toolkit Package then add MDT 2012 (Whatever your MDT version is) as a Toolkit Package.
Add Gather step then choose Gather only local data (do not process rules)


Add Set Task Sequence Variable and name it as Set System Drive TS Variable. We need to tell the task sequence which drive is System drive. Normally in WinPE mode, Task Sequence will pick the system drive as X: drive. To avoid this, we will create a custom Task Sequence variable and force the task sequence to use C drive as system drive.
On Set task Sequence variable step;
            Task Sequence Variable:  Systemdrive
            Value: C:

Add Set Task Sequence Variable step to create a custom Task Sequence variable for OSD state store path.
         Task Sequence Variable: OSDStateStorePath
         Value: %Systemdrive%\USMTOffline

Add another Set Task Sequence Variable step to add additional Capture Options
         Task Sequence Variable: OSDMigrateAdditionalCaptureOptions
         Value: /hardlink /nocompress

Create a USMToffline.cmd file and add following command to the .cmd file.

USMTOffline.cmd
***************************************************************************

@echo off
REM Creating Offline USMT folder under C:
IF EXIST "C:\USMTOffline" RMDIR C:\USMTOffline /S /Q
MD %Systemdrive%\USMTOffline

REM Creating a USMT local source folder
IF EXIST "C:\USMTSource" RMDIR C:\USMTSource /S /Q
MD %Systemdrive%\USMTSource
EXIT
****************************************************************************
Create a package (USMTOffline) and USMTOffline.cmd to this package.

Now we need to add USMTOffline package content to WinPE Windows drive by adding Run Command Line then add XCOPY ".\*.*" "%WinDir%" /E /C /Q /H /R /Y /I in Command line.

Add another Run Command line step then name it as Execute USMT copy then add cmd /c start %WinDir%\USMTScript.cmd

The USMTScript will create USMTOffline and USMTSource folders under C:\. If it is already exist in that location, the script will delete the folders then will re-create it.
Creating USMT offline folder under C:\ can be achieved easily by adding MD C:\USMTOffline and MD C:\USMTSource.

To make process easy I have created a package for the .cmd file then added to the WinPE then ran from there.
Create a USMT package (called USMT) using the source from <Program Files>\Windows AIK\Tools\USMT The source should have amd64 and x86 folders under USMT folder.
Add a Run command line to Copy USMT Source to C:\USMTSource folder as below;


At this stage we need to create a package (ScanState_Rebuild) which will have Rebuild.cmd with following command line.

Rebuild.cmd
**************************************************************************
@set USMT_WORKING_DIR=%~2%\USMTSource\amd64
"%~2\USMTSource\amd64\scanstate.exe" "%~1" /c /o /hardlink /efs:hardlink /nocompress /localonly /offlinewindir:c:\windows /v:5 /l:%~2\windows\TEMP\SMSTSLog\scanstate.log /progress:%~2\windows\TEMP\SMSTSLog\scanstateprogress.log /i:%~2\USMTSource\amd64\miguser.xml /i:%~2\USMTSource\amd64\migapp.xml

**************************************************************************
Copy the ScanState package content to C:\USMTSource by adding Run Command line, then xcopy %_SMSTSLAB0002A%* %systemdrive%\USMTSource\ /herciy in Command line box.

Add Run Command line step and name it as Run Scan state then add the commands as below;


Add Restart Computer and under specify what to run after restart; select The boot image assigned to this task sequence.


Click here for complete list of tasks for SCCM OSD All in one task sequence.
Click here for SCCM OSD All in one task sequence Visio diagram.

No comments:

Post a Comment