Jump to content


Photo

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


  • Please log in to reply
261 replies to this topic

#1 anyweb

anyweb

    Administrator

  • Root Admin
  • PipPipPip
  • 4,976 posts
  • Gender:Male
  • Location:Sweden
  • Interests:Deploying Operating systems and more with System Center Configuration Manager

Posted 19 February 2010 - 09:21 AM

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.

Attached File  Offline Mode in Windows PE using USMT 4.xml   6.62KB   2091 downloads

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

Attached File  offline mode references.jpg   119.63KB   491 downloads


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)

Attached File  set systemdrive variable.jpg   62.04KB   346 downloads

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.

Attached File  set osdstatestorepath.jpg   63.86KB   211 downloads

Finally we set the hardlink load parameters

Attached File  set hardlink load parameters.jpg   60.66KB   223 downloads


CREATE

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

Attached File  create usmt offline folder.jpg   68.02KB   208 downloads

and c:\USMTbits\X86

Attached File  create usmt bits folder.jpg   69.45KB   158 downloads


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.

Attached File  xcopy usmtbits.jpg   70.95KB   283 downloads

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

Attached File  xcopy runscanstate.jpg   67.48KB   248 downloads

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

Attached File  runscanstate-offlinewindir.bat.txt   320bytes   1735 downloads


RUN

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

Attached File  do scanstate.jpg   69.14KB   218 downloads



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,

Attached File  ts wizard welcome.jpg   39.33KB   126 downloads

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.

Attached File  cmd prompt before ts starts.jpg   52.86KB   99 downloads

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.

Attached File  copying.jpg   64.07KB   84 downloads

Attached File  do x86 scanstate.jpg   62.96KB   90 downloads

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

browse it and verify

Attached File  migrated data stored in usmt offline folder.jpg   56.46KB   96 downloads

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

Attached File  smsts.log   587.56KB   274 downloads


Ok now what ?
Microsoft MVP > Enterprise Client Management
My linkedin profile at > linkedin.com
Follow me on Twitter > ncbrady
Follow windowsnoob.com on Twitter > windowsnoob
My blog

#2 anyweb

anyweb

    Administrator

  • Root Admin
  • PipPipPip
  • 4,976 posts
  • Gender:Male
  • Location:Sweden
  • Interests:Deploying Operating systems and more with System Center Configuration Manager

Posted 23 February 2010 - 01:20 PM

Migrate XP to Windows 7 using Offline mode in Windows PE



Once you have the above working you'll want to actually Migrate XP to Windows 7 using Offline Mode in Windows PE.

Ok now you know it works, use the above theory and task sequence within a working Migrate XP to Windows 7 Task sequence.

Here's how,

Import the following task sequence

Attached File  XP to W7 Demo - X86 Offline Mode in WinPE-USMT 4.xml   13.12KB   1108 downloads

Once imported resolve the package requirements namely

* X86 boot image
* USMT 4 X86 package *special usmt 4 package containing only the x86 folder)
* Operating System image (captured Windows 7 image if you don't have one yet read this)
* ConfigMgr client package from definition
* USMT 4 (both) package containing the native x86 and x64 folders for USMT 4...
* runscanstate.bat package from above

the key bits in the TS are set hard-link load parameters

Attached File  set hard-link load parameters.jpg   60.59KB   173 downloads

and

Attached File  customize how user profiles are restored.jpg   73.05KB   170 downloads

the rest is the same as above

I'll post some more screenshots soon but here's two to get you excited :)

XP desktop before migration

Attached File  data in XP.jpg   49.17KB   87 downloads


Windows 7 desktop after migration

Attached File  done 7 desktop with migrated data.jpg   74.51KB   68 downloads

If you are having problems understanding the USMT4 packages used in this workaroun/proof of concept then please read all of this post

Related reading:

How to use USMT 4 hardlinking in a Configuration Manager 2007 Task Sequence
http://blogs.technet.com/b/configurationmgr/archive/2010/06/30/how-to-use-usmt-4-hardlinking-in-a-configuration-manager-2007-task-sequence.aspx

How can I use Offline Mode in Windows PE using USMT 4
Using a scanstate (using offlinewindir in winpe ) Task Sequence in SCCM 2007 SP2

Some Sample XP to Windows 7 task sequences showing Hardlinking
hardlinking and SMP

Customise the XML files
http://technet.microsoft.com/en-us/library/dd560786%28WS.10%29.aspx

What does USMT 4 migrate ?
http://technet.micro.../ff383238(WS.10).aspx

have fun !

cheers
niall
Microsoft MVP > Enterprise Client Management
My linkedin profile at > linkedin.com
Follow me on Twitter > ncbrady
Follow windowsnoob.com on Twitter > windowsnoob
My blog

#3 anyweb

anyweb

    Administrator

  • Root Admin
  • PipPipPip
  • 4,976 posts
  • Gender:Male
  • Location:Sweden
  • Interests:Deploying Operating systems and more with System Center Configuration Manager

Posted 25 February 2010 - 06:45 AM

screenshots describing the above process are here
Microsoft MVP > Enterprise Client Management
My linkedin profile at > linkedin.com
Follow me on Twitter > ncbrady
Follow windowsnoob.com on Twitter > windowsnoob
My blog

#4 jtbenn

jtbenn

    Newbie

  • Members
  • Pip
  • 8 posts

Posted 09 March 2010 - 03:21 AM

Man your guides are great they make it look like I know what the heck I am doing here.
I followed this one as close as I could but I must be having a brain fart.
My profiles (documents, favorites, desktop …) are not being restored to the user folders they are being left in the “C:\USMToffline\USMT” folder.
This is all that was in my c:\Windows\System32\CCM\Logs\smsts.log after Windows 7 was installed and the report for the task said success.


<![LOG[Successfully finalized logs to SMS client log directory from C:\Windows\system32\CCM\Logs]LOG]!><time="18:04:42.671+-60" date="03-07-2010" component="OSDSetupHook" context="" type="1" thread="1588" file="tslogging.cpp:1536">
<![LOG[Cleaning up task sequencing logging configuration.]LOG]!><time="18:04:42.671+-60" date="03-07-2010" component="OSDSetupHook" context="" type="0" thread="1588" file="tslogging.cpp:578">



I am not supposed to edit the miguser.xml and migapp.xml files. Am I?
The same package is used for “Restore User Files and Settings” step as for the “xcopy x86 USMTbits\X86” steps, right?

And that package has no Program (or Command Line), but only points to the source files?
I did learn (the hard way) you do not want to use “Access content directly from a distribution point when needed by the running task” in the package. That will cause it to try to copy every package folder from the server to the target machine. (I thought it was taking a bit too long)

Well, I am about to remove the tick that says “Continue if some files cannot be restored. To see if that lets me look at a log file to see what is going wrong. I think it may be trying to map the network drives or something like that.

Then reimage my test computer with XP so that I can start all over for the sixth time.
I really do appreciate all your hard work. It really helps a lot of people.


#5 anyweb

anyweb

    Administrator

  • Root Admin
  • PipPipPip
  • 4,976 posts
  • Gender:Male
  • Location:Sweden
  • Interests:Deploying Operating systems and more with System Center Configuration Manager

Posted 09 March 2010 - 04:20 AM

there are two USMT packages in this task sequence (apart from the batch file etc...)

the first one is special (a workaround), as it only points to the USMT/x86 folder (containing all files and folders within there...)

the second USMT package is normal and points to both the X86 and X64 folders (containing all files and folders within there)

does that help your problem ?

cheers
niall
Microsoft MVP > Enterprise Client Management
My linkedin profile at > linkedin.com
Follow me on Twitter > ncbrady
Follow windowsnoob.com on Twitter > windowsnoob
My blog

#6 jtbenn

jtbenn

    Newbie

  • Members
  • Pip
  • 8 posts

Posted 11 March 2010 - 11:13 PM

there are two USMT packages in this task sequence (apart from the batch file etc...)

the first one is special (a workaround), as it only points to the USMT/x86 folder (containing all files and folders within there...)

the second USMT package is normal and points to both the X86 and X64 folders (containing all files and folders within there)

does that help your problem ?

cheers
niall


That did it! You are "The MAN"
Thanks so much.

#7 jtbenn

jtbenn

    Newbie

  • Members
  • Pip
  • 8 posts

Posted 12 March 2010 - 10:02 PM

I do have another question. Is there a way to force a PXE boot without going to each machine and physically setting up the bios? I read something about the Dell Client Configuration Utility but it looks fairly complicated and only works on Dells. We mostly have Dells but we have several IBMs too. I know, if anyone knows, You Know.
Thank You.

#8 anyweb

anyweb

    Administrator

  • Root Admin
  • PipPipPip
  • 4,976 posts
  • Gender:Male
  • Location:Sweden
  • Interests:Deploying Operating systems and more with System Center Configuration Manager

Posted 14 March 2010 - 08:57 AM

using the DCCU is really really easy, download it, create a package to apply the bios setting you want (eg: boot order in bios) save that EXE file, create a package in sccm and deploy it to a test box, verify it works, deploy it to more boxes.

i don't know how IBM handles this

cheers
niall
Microsoft MVP > Enterprise Client Management
My linkedin profile at > linkedin.com
Follow me on Twitter > ncbrady
Follow windowsnoob.com on Twitter > windowsnoob
My blog

#9 FCM

FCM

    Newbie

  • Members
  • Pip
  • 6 posts

Posted 15 March 2010 - 12:57 PM

Guys great work by the way!! although my TS fails on the Run (group) do X86 scanstate part... which sccm package should I be using at this part? thanks in advance :-)

#10 anyweb

anyweb

    Administrator

  • Root Admin
  • PipPipPip
  • 4,976 posts
  • Gender:Male
  • Location:Sweden
  • Interests:Deploying Operating systems and more with System Center Configuration Manager

Posted 15 March 2010 - 04:19 PM

the first package, which I mentioned above

there are two USMT packages in this task sequence (apart from the batch file etc...)

the first one is special (a workaround), as it only points to the USMT/x86 folder (containing all files and folders within there...)

the second USMT package is normal and points to both the X86 and X64 folders (containing all files and folders within there)


Microsoft MVP > Enterprise Client Management
My linkedin profile at > linkedin.com
Follow me on Twitter > ncbrady
Follow windowsnoob.com on Twitter > windowsnoob
My blog

#11 FCM

FCM

    Newbie

  • Members
  • Pip
  • 6 posts

Posted 15 March 2010 - 05:11 PM

the first package, which I mentioned above



also I have some really crazy stuff happening ..like the xcopy stuff is copying all packages from my DP to the to the USMTbits folder.. what have I done wrong :-( I have checked the task sequence and it seems as per the download...? please help... thanks

frank

#12 FCM

FCM

    Newbie

  • Members
  • Pip
  • 6 posts

Posted 16 March 2010 - 08:44 AM

so I just want to confirm I have the TS setup correctly

xcopy USMT I am using package for the x86 folder in USMT
xcopy runscanstate I am using the batch file package
run i am using the batch file package (maybe I am wrong here?)
Restore user files and settings I am using the complete USMT package (not just x86)

so it seemed to be working up until the run part of the TS then failed but when I reeboot and go into the image that was all ready on the pc (XP)
I can see it has created the folders but hasnt copied the usmt stuff or the batch file but has copied the entire dp smspkg folder...
am I being a dougnut??? what have I missed!! :-) please help .... thanks again in advance....

#13 anyweb

anyweb

    Administrator

  • Root Admin
  • PipPipPip
  • 4,976 posts
  • Gender:Male
  • Location:Sweden
  • Interests:Deploying Operating systems and more with System Center Configuration Manager

Posted 16 March 2010 - 09:29 AM

does this help to clarify it ?

Attached File  xcopy x86.jpg   70.33KB   86 downloads

Attached File  xcopy runscanstate.jpg   66.83KB   70 downloads

Attached File  do x86 scanstate.jpg   68.29KB   59 downloads
Microsoft MVP > Enterprise Client Management
My linkedin profile at > linkedin.com
Follow me on Twitter > ncbrady
Follow windowsnoob.com on Twitter > windowsnoob
My blog

#14 FCM

FCM

    Newbie

  • Members
  • Pip
  • 6 posts

Posted 16 March 2010 - 11:57 AM

Thanks Niall really appreciate your help.... last one I promise my TS fails on the last step Restore user files and settings with error code 0x8007001c so for this step I used the x86 USMT package it failed also tried the complete USMT package and this still failed... although the win7 image is applied and everything else seems good.. USMT folder is there.... but just not completing the restore ....

#15 Dennis

Dennis

    Member

  • Members
  • PipPip
  • 11 posts

Posted 19 March 2010 - 01:47 PM

FCM: I think it don't work if you use "Access content directly from a distribution point when needed by the running task" I had exactly the same errors as you.

So I cant use this method :( because if i don't use Access content directly from a distribution point when needed by the running task the SCCM process is way to slow.

#16 FCM

FCM

    Newbie

  • Members
  • Pip
  • 6 posts

Posted 19 March 2010 - 03:56 PM

FCM: I think it don't work if you use "Access content directly from a distribution point when needed by the running task" I had exactly the same errors as you.

So I cant use this method :( because if i don't use Access content directly from a distribution point when needed by the running task the SCCM process is way to slow.



cheers I managed to get that in the end... what package did you use for the restore part of the task sequence ?? my fails..what have I missed?? thanks again...

#17 omnifred

omnifred

    Newbie

  • Members
  • Pip
  • 2 posts

Posted 24 March 2010 - 09:02 AM

What i miss in al these steps is a wipe from the directorys that are not needed (windows,program files, users...etc)if you look at the logfiles in MDT 2010 with USMT hardlink scan, you see that the directorys get wiped from the disk instead of a format.
can somebody explain this to me, i would like to use Offline USMT in a XP deploymend (XP to XP) and got eveything working bud i doubt that the directorys get wiped

#18 anyweb

anyweb

    Administrator

  • Root Admin
  • PipPipPip
  • 4,976 posts
  • Gender:Male
  • Location:Sweden
  • Interests:Deploying Operating systems and more with System Center Configuration Manager

Posted 24 March 2010 - 10:15 AM

you cant use offline mode for XP to XP, it's not supported, this is designed for XP to windows 7

cheers
niall
Microsoft MVP > Enterprise Client Management
My linkedin profile at > linkedin.com
Follow me on Twitter > ncbrady
Follow windowsnoob.com on Twitter > windowsnoob
My blog

#19 Eswar Koneti

Eswar Koneti

    MCTS

  • Moderators
  • PipPipPip
  • 635 posts
  • Gender:Male
  • Location:Singapore
  • Interests:Computers,Gaming

Posted 10 April 2010 - 06:34 AM

Created a Media from the TS(off-line mode) and boot from DVD on a standalone machine to upgrade to win 7 but it fails at wiping the system Drive task.could not find any error messages form the smsts.log .Attached the screenshot as well Log file.(PAckage ID:C0100047 is runscan state and C0100049 is USMTx86) .anything wrong in the TS?

Attached Files


Microsoft Community Contributor Award 2013 - MCTS
Configmgr Blog @ www.eskonr.com
My LinkedIn profile @ linkedin.com

#20 anyweb

anyweb

    Administrator

  • Root Admin
  • PipPipPip
  • 4,976 posts
  • Gender:Male
  • Location:Sweden
  • Interests:Deploying Operating systems and more with System Center Configuration Manager

Posted 10 April 2010 - 08:28 AM

hi Eswar,

if you press f8 before it gets this far can you browse to c:\ and do you see the folders we need to create like c:\usmtoffline etc ? remember when testing if you fail for whatever reason that you'll have to delete those two usmt folders as i havn't built in any checking into the TS to see if they are there already (in the create folder part...)
Microsoft MVP > Enterprise Client Management
My linkedin profile at > linkedin.com
Follow me on Twitter > ncbrady
Follow windowsnoob.com on Twitter > windowsnoob
My blog




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

Locations of visitors to this page