Jump to content

  • 0

using Offline Mode in Windows PE using USMT 4 via a task sequence in SCCM 2007 SP2


hi all,


Note: This post has been reproduced in a webcast, so if you'd like to see a video of Offline Mode in WinPE then click here




well this feature in USMT 4 is handy, as it allows you to do a scanstate while in Windows PE in other words, not in the OS so no problems with services running or applications running meaning that you get to backup everything you want without any locked files stopping from doing so.


Offline mode does however have some restrictions, read this page on Technet for details of that. To get around these restrictions and to migrate wallpaper see here, to migrate your network printers see here.



Great, but how do I do Offline Mode in Windows PE using SCCM ?


according to Microsoft, we can use the /offlinewindir switch in USMT 4 with scanstate.


/offlinewindir: "path to a windows directory"



This option specifies the offline Windows directory that the ScanState command gathers user state from. The offline directory can be Windows.old when you run the ScanState command in Windows or a Windows directory when you run the ScanState command in Windows PE. This option is incompatible with the /offline option.


However, implementing it isn't so straigtforward as you've probably already discovered and documentation about getting it to work within SCCM is as far as I can see pretty much non-existant,

so here courtesy of windows-noob.com is one way of doing it, feel free to show us other ways.


The theory behind this:-


As the Capture User State Step in a standard task sequence can only run in Windows, we cannot use that step to do our scanstate while in Windows PE, therefore we will use some tricks to run scanstate from WinPE.


To do this we create two special packages, the first package contains a batch file which calls the scanstate.exe file and the second package is the entire USMT X86 scanstate files and folders, (note: in this example we are using scanstate from the X86 folder).


This means that we create a separate package to the normal USMT4 package and this is only because this example is a workaround or proof of concept to prove that Offline Mode in Windows PE can be done via a Task Sequence in SCCM.


Update: If you would like sample code to check for and use the correct USMT architecture in offline mode then see Peters post here



Get your lab ready


We need a Windows XP client machine to test scanstate on and you should enable the F8 command prompt option in your boot.wim (you'll need it).



The Task Sequence


You can use this Task Sequence in SCCM by importing it. Please note this task sequence only has the 4 groups in it, if you want the 4 groups plus OSD then use the other Task Sequence further down.


Offline Mode in Windows PE using USMT 4.xml


The task sequence depends on three packages, the X86 bits from your USMT 4 (ie: copy everything in the X86 folder from C:\Program Files\Windows AIK\Tools\USMT folder. There are two versions, one for 32bit (X86) and one for 64bit (amd64), we are only using the X86 bits in this guide), the Batchfile


offline mode references.jpg



I break up my task sequence into four distinct groups, Set, Create, xcopy and Run





In the Set group I set SystemDrive to c: (otherwise it will try and do this on the windows PE x: drive)


set systemdrive variable.jpg


Next we set the OSDStateStorePath Task Sequence Variable to %systemdrive%\USMToffline which translates to c:\USMToffline, this directory will store our migration data during scanstate operations and when the new os is being applied.


set osdstatestorepath.jpg


Finally we set the hardlink load parameters


set hardlink load parameters.jpg





In the Create group we just create two folders, c:\USMToffline,


create usmt offline folder.jpg


and c:\USMTbits\X86


create usmt bits folder.jpg



the c:\USMTbits\X86 will store all our scanstate native files.





In the xcopy group we do the clever stuff, we copy the X86 USMT stuff to the newly created folder, and then we copy our batch file for later user.


xcopy usmtbits.jpg


The batch file itself has the following contents



@set USMT_WORKING_DIR=%~2%\USMTbits\x86

"%~2\USMTbits\x86\scanstate.exe" "%~1" /c /o /hardlink /efs:hardlink /nocompress /offlinewindir:c:\windows /v:5 /l:%~2\windows\TEMP\SMSTSLog\scanstate.log /progress:%~2\windows\TEMP\SMSTSLog\scanstateprogress.log /i:%~2\USMTbits\x86\miguser.xml /i:%~2\USMTbits\x86\migapp.xml


xcopy runscanstate.jpg


You can download the batchfile below however you must rename it back to .bat







The Run group does the actual running of the batch file and passes two variables to the file.


do scanstate.jpg




Testing Offline Mode.


Create an optional advertisement to a Migrate XP to W7 X86 collection for the Task Sequence and PXE boot your XP client (press F12 first....), select the Task Sequence when the wizard appears,


ts wizard welcome.jpg


at this point press F8 to bring up the command prompt, you are doing this to verify that your data is getting migrated in OFFLINE mode. So here we can see the command prompt is open.


cmd prompt before ts starts.jpg


Ok switch back to the TS and start the task sequence. You will see it starts creating the folders, copying the USMT stuff and our batch file(s) and then actually running the scanstate command.




do x86 scanstate.jpg


Once it is completed your migrated data will now be stored in C:\USMToffline\USMT


browse it and verify


migrated data stored in usmt offline folder.jpg


If you want to see a working SMSTS.log file from the above test see below





Ok now what ?

Share this post

Link to post
Share on other sites

Recommended Posts

  • 0

in the configmgr console select your task sequence and click on the references tab, do you see your USMT 4 package as well as the USMT 3 package ? you probably have both packages referenced in the task sequence and will have to go through any step which captures state (or restores it) to fix the package

Share this post

Link to post
Share on other sites

  • 0

i am one quick question migration (windows xp to win7) can i have a working hardlink


hi Vishnu,


that is not a question,

what exactly are you trying to do ? are you trying Offline mode in WinPE ? if not then create a new topic explaining what you've tried and what your problem is..

Share this post

Link to post
Share on other sites

  • 0



I was wondering if you could help me out. I have created the task sequence from building upon XP to W7 Demo - X86 Offline Mode in WinPE-USMT 4 and I am running it it from a usb drive.


Everything is working fine and the pc is been added to the domain except the users setting are not been restored. The USMT offline folder has been created and is on the C drive.


I have attached the task sequence I am using. Would I need to create a batch file to restore the users profiles rather than use USMT 4 during the restore?


Any help would be much appreciated as I have 5000 pc's and laptops to build over the next year.

XP to W7 Demo - X86 Offline Mode itest.xml

Share this post

Link to post
Share on other sites

  • 0

  • I am still getting the same errors on my sequence when it tries to run scanstate in my lab sequence. I have imported the Demo Task sequence and set everything up excalty as in the demo ( i have done this several times.) It's gotta be something small I am missing but every time I get the Invalid Store Argument error. I have not edited any of the XML files. Just trying to run the Proof of concept portion of the script.

2012-05-10 12:40:41, Info [0x000000] USMT Started at 2012/05/10:12:40:41.947

2012-05-10 12:40:41, Info [0x000000] Command line: \USMTbits\x86\scanstate.exe /c /o /hardlink /efs:hardlink /nocompress /offlinewindir:c:\windows /v:5 /l:\windows\TEMP\SMSTSLog\scanstate.log /progress:\windows\TEMP\SMSTSLog\scanstateprogress.log /i:\USMTbits\x86\miguser.xml /i:\USMTbits\x86\migapp.xml

2012-05-10 12:40:41, Status [0x000000] Activity: 'MIGACTIVITY_COMMAND_LINE_PROCESSING'

2012-05-10 12:40:41, Info [0x000000] Failed.[gle=0x00000091]

2012-05-10 12:40:41, Info [0x000000] USMT Status 1033 (STORE_ARGUMENT_ERROR): An error occurred processing the command line.

\USMTbits\x86\scanstate.exe ##ERROR## --> /c /o /hardlink /efs:hardlink /nocompress /offlinewindir:c:\windows /v:5 /l:\windows\TEMP\SMSTSLog\scanstate.log /progress:\windows\TEMP\SMSTSLog\scanstateprogress.log /i:\USMTbits\x86\miguser.xml /i:\USMTbits\x86\migapp.xml

Settings store argument specified is invalid[gle=0x00000091]

2012-05-10 12:40:41, Info [0x000000] USMT Completed at 2012/05/10:12:40:41.962[gle=0x00000091]

2012-05-10 12:40:41, Info [0x000000] Entering MigShutdown method

2012-05-10 12:40:41, Info [0x000000] Leaving MigShutdown method

Share this post

Link to post
Share on other sites

  • 0

Hi i was wondering if some could help me with this . my task sequence fails on Running action : xcopy x86 USMT TO USMTbits\x86 with error code 0x00000004


i have set the Set SystemDrive Variable to c





it does create the USMTbits and USMToffline Folders and looks like its download the files as well .


i have also changed my Create and XCOPY command line to the following


Create USMT folder to store USMT packages TO cmd.exe /c md %systemdrive%\USMTbits


xcopy X86 USMT to USMTbits\X86 TO xcopy %_SMSTSCIS00058%* %systemdrive%\USMTbits\ /herciy


I have done this as i want to use the Full USMT Package


i also have attached my TS and log file



Share this post

Link to post
Share on other sites

  • 0

Hi all,


I just joined the site today. First and foremost, many sincere thanks to Niall for making such great contributions to these forums. I've been following your posts for a while and decided to join this forum.


One question I have regarding this TS for offline migrations from XP to Win7. Is there a way to incorporate these steps in the MDT 2012 UDI TS w/ SCCM 2007. Currently I have a working MDT 2012 UDI TS on SCCM which is only doing the New Computer scenario. Everything works well. I need to perform some very basic user data backup incl network printer mappings in offline mode. If you could guide me as to where to add these steps so that the UDI wizard can pass the variables correctly to the TS steps, that would be huge help.


I've attached copy of my TS.


Thanks and everyone keep up the great work.

Win 7 with Core Apps.xml

  • Like 1

Share this post

Link to post
Share on other sites

  • 0

as Peter says, the only way to find out what is working or not with your migration is to examine the scanstate.log and loadstate.log files generated by USMT

Share this post

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Create New...