Jump to content


  • 0
anyweb

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

Question

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

 

SET

 

 

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

 

 

CREATE

 

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.

 

 

XCOPY

 

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

 

runscanstate-offlinewindir.bat.txt

 

 

RUN

 

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.

 

copying.jpg

 

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

 

smsts.log

 

 

Ok now what ?

Share this post


Link to post
Share on other sites

Recommended Posts

  • 0

I've got another question for the USMT experts (anyone here?).

 

I've got this offline TS working 100%, except my "Favorites" are not copying properly. This is in an XP with IE8 environment to Win7 with IE9.

 

The scanstate is definitely capturing the favorites folder as it's supposed to, since I can see them in the C$ folder of the Hardlinks' USMTOffline folder. Then, then loadstate is definitely 'processing' them, as seen in the attached screenshot.

 

For whatever reason though, my favorites are not restored to C:\Users\User1\favorites as they're supposed to be, I simply have the default "Favorites bar" and "Websites for the United States" folders in there.

 

Anyone experience this before, or know what is interfering with the Favorites transfer? FYI I am using a slightly modified MigUser.xml and MigApp.xml (but I've also tested with the barebones config files), in addition to the Printers.xml and Wallpaper.xml files that were provided in this thread.

post-11371-0-73184800-1316099299_thumb.jpg

Share this post


Link to post
Share on other sites

  • 0

Hi Niall

 

One thing i have noticed is Offline Migration ScaState Progress Bar doesnt show realistic scanstate progress UI like when compared to FullOS Scanstate Progress bar (which shows as Capturing User Files and Settings), is there a way to bringup the Progress bar which is realistic while scanstate is running in Offline?

 

Thank you

Share this post


Link to post
Share on other sites

  • 0

I use migrecover 3. It works great.

 

Within SCCM 2007:

Click on Computer Association

Right click on PC that needs data recovered

Select View Recovery Information

Copy User State Recovery Key

Browse to User state store location (if no location shown, then it can be found by looking at the advertisement data)

 

On my local pc:

create folders: c:\migrecover\recover

extract the migrecover program into migrecover folder

copy .mig file from user state store location to c:\migrecover

type MigRecover.exe <source MIG file> <destination path> [user State Recovery Key]

 

ex: c:\migrecover.exe USMT.mig c:\migrecover\recover\johnsmith\ 92e879342847298427429436677676

 

note: spaces are before USMT.mig and after USMT.mig and another space after destination path and before user state recovery key

 

For the most part data is now recovered. Occassionally you'll find that the data is corrupted, but after hundreds of times using this because our USMT doesn't always replace the users data automatically, I've only had a couple corrupted .mig files.

Share this post


Link to post
Share on other sites

  • 0

Hi there,

Great write up of how to do USMT, i'm attempting to follow it through to refresh our Windows 7 installation but I'm running into a bit of trouble at the moment with the scanstate task, it keeps failing with the error

 

"Failed to run the action: do X86 scanstate. The specified disk or diskette cannot be accessed. (Error: 0000001A; Source: Windows) TSManager 31/10/2011 3:02:53 p.m. 1432 (0x0598)" which is from the smsts log.

 

If I open the ScanState log I get this error 2011-10-31 15:02:53, Error [0x000000] Invalid Windows folder for offline gather to start - c:\windows[gle=0x00000003]

 

I have uploaded the SMSTS log and the ScanState log

 

Any help would be much appreciated

Share this post


Link to post
Share on other sites

  • 0

Following up with this I think that it's related to the Windows 7 "System Reserved" partition that is created at the front of the drive. Win PE sees this drive as the C: drive and the actual C: drive as the D: drive, this is causing all sorts of problems...

Share this post


Link to post
Share on other sites

  • 0

well if you didnt find the user state then either scanstate or loadstate failed, review the logs to find out which did (usually scanstate fails, so review scanstate.log)

Share this post


Link to post
Share on other sites

  • 0

Hi,

After apply windows...i found this error.

Expand a string: FullOS TSManager 17/01/2012 5:17:51 PM 1456 (0x05B0)

!bInWinPE, HRESULT=80070032 (e:\nts_sms_fre\sms\client\tasksequence\executionengine\instruction.cxx,2725) TSManager 17/01/2012 5:17:51 PM 1456 (0x05B0)

The step (Restore User State) must be running in full OS TSManager 17/01/2012 5:17:51 PM 1456 (0x05B0)

!--------------------------------------------------------------------------------------------! TSManager 17/01/2012 5:17:51 PM 1456 (0x05B0)

Failed to run the action: Restore User State.

The request is not supported. (Error: 80070032; Source: Windows) TSManager 17/01/2012 5:17:51 PM 1456 (0x05B0)

Sending status message . . . TSManager 17/01/2012 5:17:51 PM 1456 (0x05B0)

Send a task execution status message SMS_TSExecution_ActionFailError TSManager 17/01/2012 5:17:51 PM 1456 (0x05B0)

MP server kol-sccm-child.mps.lan and port 80. SSL=false. CRL=false. TSManager 17/01/2012 5:17:51 PM 1456 (0x05B0)

Site code: MPC TSManager 17/01/2012 5:17:51 PM 1456 (0x05B0)

Client machine name: TESTCLIENT TSManager 17/01/2012 5:17:51 PM 1456 (0x05B0)

Client Identity: GUID:0ABBFA55-7DA8-407B-A27B-A4CA86DFBD8B TSManager 17/01/2012 5:17:51 PM 1456 (0x05B0)

Advertisement ID: MPC2004E TSManager 17/01/2012 5:17:51 PM 1456 (0x05B0)

Package ID: MPC00049 TSManager 17/01/2012 5:17:51 PM 1456 (0x05B0)

Sending StatusMessage TSManager 17/01/2012 5:17:51 PM 1456 (0x05B0)

Formatted header: TSManager 17/01/2012 5:17:51 PM 1456 (0x05B0)

<Msg SchemaVersion="1.1" ReplyCompression="zlib"><ID/><SourceID>2ed14f2e-4f79-419f-9a9e-a1c5e0e1a957</SourceID><SourceHost/><TargetAddress>mp:[http]MP_StatusManager</TargetAddress><ReplyTo>direct:OSD</ReplyTo><Priority>3</Priority><Timeout>3600</Timeout><SentTime>2012-01-17T11:47:51Z</SentTime><Protocol>http</Protocol><Body Type="ByteRange" Offset="0" Length="2186"/><Hooks/><Payload Type="inline"/><TargetHost/><TargetEndpoint>StatusReceiver</TargetEndpoint><ReplyMode>Sync</ReplyMode><CorrelationID/></Msg>

TSManager 17/01/2012 5:17:51 PM 1456 (0x05B0)

CLibSMSMessageWinHttpTransport::Send: URL: kol-sccm-child.mps.lan:80 CCM_POST /ccm_system/request TSManager 17/01/2012 5:17:52 PM 1456 (0x05B0)

The request has succeeded. 200 OK TSManager 17/01/2012 5:17:52 PM 1456 (0x05B0)

Set a global environment variable _SMSTSLastActionRetCode=50 TSManager 17/01/2012 5:17:52 PM 1456 (0x05B0)

Set a global environment variable _SMSTSLastActionSucceeded=false TSManager 17/01/2012 5:17:52 PM 1456 (0x05B0)

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.

Guest
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.

Loading...


×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.