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

thank you Peter.

 

1. is there an easy work around to use the original dvd/iso? just curious

 

2. i am a newbie, do not know much about sccm, when you said "ComputerVariable to add the License Key" i don't really get it. sorry.

 

My problem is that I want to use a golden window 7 image that is not been syspreped, so when i migrade my xp to win7, i do not need to enter a key. I did create this nonsyspred image with the help of MDT. But when tried to use it in this scenario, it failed. It skipped the step of applying the window setting and network setting, so the pc name did not change, and it did not join domain.

 

I just wonder is there anyway to use a nonsyspreped image? if yes, how.

Share this post


Link to post
Share on other sites

  • 0

Firstly, I'd just like to say thank you for such a great post. I've learned a lot from this topic and your explanations are really clear and thorough.

 

I'm not sure what I am doing wrong but for some reason the c: drive under XP has become the d: drive under windows 7 and there is no longer any c: drive.

 

Is this by design or have I set one of my tasks up incorrectly?

Share this post


Link to post
Share on other sites

  • 0

Firstly, I'd just like to say thank you for such a great post. I've learned a lot from this topic and your explanations are really clear and thorough.

 

I'm not sure what I am doing wrong but for some reason the c: drive under XP has become the d: drive under windows 7 and there is no longer any c: drive.

 

Is this by design or have I set one of my tasks up incorrectly?

 

 

Did you read the above post ? Are you using the default install.wim from win 7 ISO Media ?

 

The default Vista/W7/2008 install.wim (on the DVD) will always install to the D: drive if not using an install package in SCCM (e.g. running setup.exe).

To aviod this

1. add a operating system install package in sccm with the default W7 DVD (do not add it as an operating system image)

2. create a build and capture task sequence, that will deploy the OS to the C:\ drive using setup.exe, and then capture it from the C:\ drive

3. add the captured image as a operating system image (not install package) to SCCM

4. create a deploy task sequence, that joins the image to the domain etc (but not run setup.exe)

 

Step by step with screen shots are avilable here http://www.windows-noob.com/forums/index.php?/forum/63-deploy-7/.

Share this post


Link to post
Share on other sites

  • 0

Hi

 

Thanks so much for this post and your hard work - it has saved me so much time and hundreds of headaches :)

 

I have managed to get the whole process working smoothly and perfectly, with one minor leftover question - should the USMToffline directory be automatically deleted during the process? Because although all user files and settings are being restored correctly, the USMToffline folder and all of its contents remain on the C: I can't seem to delete the folder manually, as I get a message that a file in the directory is in use.

 

I suppose it doesn't hurt it being there, though it takes up space and if I need to reimage the machine again in the future the scanstate will probably fail due to the folder already existing...

 

Have I missed some "clean up" step in the TS?

 

Thanks again for an extremely useful post :)

Share this post


Link to post
Share on other sites

  • 0

Hi,

 

Thank you for this post. It is indeed very useful.

 

I tried both online & offline mode in USMT. I have not achieved 100% success.

I have to migrate a Windows 7 Pro system to Windows 7 Pro. USMT is considered as a good tool for this PC refresh scenario.

The only issue is that I have two partitions in the source computer, & the user profile (My Documents, Desktop, favourites, etc) is pointing to the D:\Users & not C:\Users, using the registry (My Company's requirement).

When the source computer is migrated to Windows 7 again, the image that is applied to it, too has two partitions with User profile pointing to D:\Users (only data in user profile like My Documents, Desktop, favourites, etc).

The issue I face is that although i am able to get my user profile back, in terms of (My Documents, Desktop, favourites, etc), I happen to loose many files in the root of C drive.

For example, if i had placed ten files & folders in the root, C drive, post migration i can see only one file restored.

The remaining files that didnt get restored are having extensions such as *.exe, *.pdf, *.zip.

Am i missing anything ?

Also can you pls assist me to migrate network printer settings as well from window 7 to Windows 7.

 

I would really appreciate some help on this subject.

Edited by arthur

Share this post


Link to post
Share on other sites

  • 0

Thanks for this guide. Everything is working great up to the very end and I'm not sure what is going on with the restore. I am using the /MD:oldDomain:NewDomain switch to move the XP user into W7 and a new domain. The user profile is backed up in the c:\USMTOffline folder, and it is even restored with the correct NewDomainName\Username, but apparently the SIDs don't match because when I login for the first time in W7, a new profile is created. Where would I begin in troubleshooting this problem?

 

Thanks!

Share this post


Link to post
Share on other sites

  • 0

hi Jason,

to start off with, if you retain the same domain does everything migrate as expected for the user (leave out the /MD switch) ?

 

cheers

niall

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.