The TechNet documentation for System Configuration Manager contains instructions for creating Prestaged Media at the below links:
System Center Configuration Manager 2007How to Create Task Sequence Prestaged Mediahttp://technet.microsoft.com/en-us/library/gg294170.aspx
System Center 2012 Configuration ManagerHow to Deploy Operating Systems by Using Media in Configuration ManagerHow to Create Prestaged Mediahttp://technet.microsoft.com/en-us/library/79465d90-4831-4872-96c2-2062d80f5583#BKMK_CreatePrestagedMedia
However there are no instructions on TechNet regarding how to apply the Prestaged Media to a hard drive for delivery to an OEM. The following article covered single partition scenarios for BIOS PCs:
How to stage Task Sequence Prestaged Media on a hard drive in Configuration Manager 2007http://blogs.technet.com/b/configurationmgr/archive/2011/01/11/how-to-stage-task-sequence-prestaged-media-on-a-hard-drive-in-configuration-manager-2007.aspx
However, the article does not cover multi-partitioned scenarios such as:
This article will cover how to properly apply Task Sequence Prestaged Media on multi-partitioned volumes. Since Prestaged Media was introduced in R2 of ConfigMgr 2007, this article is only applicable when either R2 or R3 is installed as part of ConfigMgr 2007 SP2 or when using ConfigMgr 2012.
There are two ways to properly apply a Task Sequence Prestaged Media on a hard drive:
Click on the section below to take you to the area of your interest:
Manually Apply A Task Sequence Prestaged Media On A Hard Drive
The steps for applying Prestaged Media are different for BIOS PCs vs. UEFI PCs, therefore two different sections are provided - one for BIOS PCs and another for UEFI PCS. Please select the method that is applicable:
The following instructions apply to BIOS PCs for both ConfigMgr 2007 SP2 R2/R3 and ConfigMgr 2012 SP1 and newer.
This step will apply the Prestaged Media to the OS partition and will take a few minutes to complete.
In ConfigMgr 2012 SP1, the variable OSDPreserveDriveLetter was added that allowed an administrator to specify what they wanted the drive letter to be in the new Windows OS. If OSDPreserveDriveLetter is set to TRUE (default), it will use the drive letter assigned in the captured OS WIM. If OSDPreserveDriveLetter is set to FALSE, it will use the drive letter assigned to the OS partition in WinPE. In most cases administrators want the new Windows OS to be assigned a drive letter of C:. However under certain scenarios, this may not be possible using the OSDPreserveDriveLetter variable. Consider the following scenario:
In the above scenario since both the captured OS WIM and the OS partition in WinPE are assigned a drive letter of D:, regardless of what the variable OSDPreserveDriveLetter is set to, the new Windows OS will end up on drive letter D:. This is undesirable for most administrators.
To resolve the problem, commands can be added to the winpeshl.ini file that reassigns drive letters in WinPE so that the OS partition is given a drive letter of C:. This is can be done via a DiskPart script that is launched by winpeshl.ini before it launches the Task Sequence. Winpeshl.ini is the file that controls what is launched after WinPE finishes loading.
To implement the solution follow the below steps. If you are using ConfigMgr 2007 or you do not want to implement the solution, skip to Step 24 to complete applying the Prestaged Media to the hard drive.
Unless testing to make sure the Prestaged Media works, DO NOT turn the PC back on after Step 24 or else the whole process will need to be repeated from Step 1. A this point the Task Sequence Prestaged Media file has been successfully applied to the hard drive of the PC and the boot partition has been properly prepared to be booted from the Prestaged Media. The hard drive should be ready for delivery to the OEM.
The following instructions apply to UEFI PCs for ConfigMgr 2012 SP1 and newer. Since UEFI support was introduced in ConfigMgr 2012 SP1, the below steps are not intended for ConfigMgr 2007 SP2 R2/R3.
There is a know issue in ConfigMgr 2012 SP1 and ConfigMgr 2012 R2 where when booting from Prestaged Media on a UEFI PC, after applying the Prestaged Media, it will boot successfully to the Task Sequence Wizard the first time the PC is booted. However if a Task Sequence is not selected from the Task Sequence Wizard and instead the Task Sequence Wizard is canceled, the PC will restart and any subsequent boots will not succeed. The reason that this happens is that the Task Sequence Wizard deletes the boot files from the EFI partition.
This issue can be worked around by adding commands to the winpeshl.ini file that backs up the boot files from the EFI partition and later restores the boot files after the Task Sequence has deleted them. Winpeshl.ini is the file that controls what is launched after WinPE finishes loading.
To implement the workaround follow the below steps. If you do not want to implement the workaround, skip to Step 24 to complete applying the Prestaged Media to the hard drive.
Unless testing to make sure the Prestaged Media works, DO NOT turn the PC back on after Step 24 or else the whole process may need to be repeated from Step 1. A this point the Task Sequence Prestaged Media file has been successfully applied to the hard drive of the PC and the boot partition has been properly prepared to be booted from the Prestaged Media. The hard drive should be ready for delivery to the OEM.
Please note that the problem where the OS does not end up on drive letter C: as described under the BIOS section usually only occurs on BIOS PCs. It does not occur on UEFI PCs because the partitions that precede the OS partition (the EFI, MSR, and if created, the Recovery partitions) normally are not assigned a drive letter in WinPE. The end result is that for UEFI PCs the OS partition in WinPE receives a drive letter of C: because it is the first partition to receive a drive letter. However to ensure that the OS ends up on the C: drive, in the Task Sequence that utilizes the Prestaged Media, the variable OSDPreserveDriveLetter may need to be set to FALSE.
Automate Applying A Task Sequence Prestaged Media On A Hard Drive Via A Task Sequence
The process of applying the Task Sequence Prestaged Media can be automated via a Task Sequence. For ConfigMgr 2012 SP1 and newer, via the variable _SMSTSBootUEFI, one Task Sequence can be used to apply the Prestaged Media on either BIOS or UEFI PCs. The Task Sequence can be a bit difficult to create via a manual step by step process due to the logic involved, so instead of a step by step process describing the creation of the Task Sequence, an exported version of the Task Sequence with all of the steps and logic is provided as a download link below.
It is important to note that when applying the Task Sequence Prestaged Media on a hard drive, it is not a requirement to import the Prestaged Media into the ConfigMgr console. However the Task Sequence in this article uses the Apply Data Image task to apply the Prestaged Media. When using the Apply Data Image task it is required that the Prestaged Media be imported as an Operating System Image in the ConfigMgr console and then distributed to a Distribution Point(s).If you do not wish to import the Prestaged Media into the ConfigMgr console, instead of using the Apply Data Image task, a Run Command Line task can be used to manually run DISM to apply the Prestaged Media from a predetermined location. The Task Sequence in this article also contains a Run Command Line task that manually applies the Prestaged Media via DISM, but it is disabled by default. Due to the WinPE 3.x boot images of ConfigMgr 2007 missing tools that can manually apply WIM image files (imagex.exe or a version of DISM that supports the /apply-image option), this option is only possible when using ConfigMgr 2012 SP1 or newer. The tools could be added to the WinPE 3.x boot images, but this is beyond the scope of this article.
Please select the method that you would prefer to use:
Apply The Prestaged Media Via The Apply Data Image Task
To use a Task Sequence to automate applying the Prestaged Media on a hard drive via the Apply Data Image task:
Unless testing to make sure the Prestaged Media works, DO NOT turn the PC back on after Step 13 or else the Task Sequence will need to be rerun on the PC. A this point the Task Sequence Prestaged Media file has been successfully applied to the hard drive of the PC and the boot partition has been properly prepared to be booted from the Prestaged Media. The hard drive should be ready for delivery to the OEM.
Apply The Prestaged Media Via The Run Command Line Task (ConfigMgr 2012 SP1 or newer only)To use a Task Sequence to automate applying the Prestaged Media on a hard drive via the Run Command Line task:
Please note that if you plan to have the Prestaged Media on a local drive such as a USB Flash Drive, this task can be disabled by clicking on the Options tab, and then clicking on the Disable this step option
Unless testing to make sure the Prestaged Media works, DO NOT turn the PC back on after Step 16 or else the Task Sequence will need to be rerun on the PC. A this point the Task Sequence Prestaged Media file has been successfully applied to the hard drive of the PC and the boot partition has been properly prepared to be booted from the Prestaged Media. The hard drive should be ready for delivery to the OEM.
Please note that in Step 12, a local drive, such as a USB Flash Drive, can be used instead of a network drive. This approach would not require the Connect to Network Folder task. However the main challenge with this approach is determining what the drive letter of the local drive will be in WinPE so that the path to the Prestaged Media can be properly modified in Step 12.
Considerations For The Task Sequence That Utilizes The Prestaged Media
Delivery Of Prestaged Media To OEM
After each of the above methods describing how to apply Prestaged Media, there is a note pointing out to make sure not to turn the computer back on once the process is complete. At this point, normally the hard drive is pulled from the PC and delivered to the OEM. The OEM then duplicates the hard drive and makes an image of it. The OEM then applies the image to all PCs shipped from them to the end customer.
However, instead of delivering a physical hard drive to the OEM, Stand-alone Media containing the Prestaged Media and the Task Sequence from this article can be delivered to the OEM. The OEM could then run the Stand-alone media on one of the model PCs, pull the hard drive themselves, and perform any additional disk duplication and image creation that is part of their process.
To accomplish this, make sure to follow the Apply The Prestaged Media Via The Apply Data Image Task section and then after Step 11, instead of running the Task Sequence locally, create Stand-alone media. The Stand-alone media can then be delivered to the OEM.
Instructions on how to create Stand-alone media are in the below TechNet articles:
System Center Configuration Manager 2007How to Create Stand-alone Mediahttp://technet.microsoft.com/en-us/library/bb632784.aspx
System Center 2012 Configuration ManagerHow to Deploy Operating Systems by Using Media in Configuration ManagerHow to Create Stand-alone Mediahttp://technet.microsoft.com/en-us/library/79465d90-4831-4872-96c2-2062d80f5583#BKMK_CreateStandAloneMedia
Wilhelm KocherSenior PFE - EMEA
Steve RachuiSenior PFE - US
Frank RojasSenior Support Escalation Engineer
Fantastic post guys, this is awesome.I've picked up a minor error in the downloadable task sequence. The step called 'Run DiskPart Script to Assign EFI Partiton S:' is missing the windows directory in the path, it is currently set to x:\system32\diskpart.exe.I'm also getting Windows Boot Manager error 0xc000000e on first boot after applying the prestaged media via the offline media method. Will keep testing to diagnose the cause.
Thank you for the catch Peter. I have replaced the downloadable Task Sequence with a corrected one. Please let me know how your stand-alone media works. I actually never specifically tested this scenario and just assumed it would work. I will test when I get a chance.
Excellent! Successfully deployed to a test Surface Pro and to a Surface Pro 2...I have been beating my head against the wall trying to get pre-staged media ready for our hardware vendor for a large order of Surface Pro 2 devices for physicians. Your sequence
has saved our deployment engineers many hours of manually booting from USB drives...
Thanks for this article! Though not sure I understand.
We have a recovery partition and a OS partition, is this the only way to apply the image to the harddisk? I seem to be able to format the disk in 2 partitions, then applying the prestaged image to volume 2. Only thing is it assigned a driveletter to recovery
partition. We do not want the recovery partition to be assigned a driveletter.
Hi Peter...did you find a fix to the 0xc000000e error? I am seeign the same issue.
I ran into one problem with the directions for including a recovery partition in the UEFI situation. When I tried to run "Attributes Volume Set NoDefaultDrive Letter", I got an error:
Virtual Disk Service Error:
The object is not found
I found that after running the Set ID="de94bba4-06d1-4d40-a16a-bfd50179d6ac" command, the volume was marked as hidden, which seems to be what caused this error. I was able to get around the issue by putting the Attributes command before the set ID command,
as shown below:
Create Partition Primary Size=300
Format FS=NTFS Label=Recovery Quick Override
Attributes Volume Set NoDefaultDriveLetter
Frank - did you ever get a chance to test the method for UEFI systems?
I'm also getting the Windows Boot Manager error 0xc000000e when I boot a machine that has had the prestaged image applied using the UEFI steps listed. I have used the BIOS steps successfully on another machine.
We have tested the methods described in this article with images in the Prestaged media built using the following methods:
1) Captured Windows OS WIM created on a UEFI PC via a Build and Capture Task Sequence from source files (Operating System Installer)
2) Captured Windows OS WIM created on a BIOS PC via a Build and Capture Task Sequence from source files (Operating System Installer)
3) Captured Windows OS WIM created on a UEFI PC via a Build and Capture Task Sequence from Install.wim (Operating System Image)
4) Captured Windows OS WIM created on a BIOS PC via a Build and Capture Task Sequence from Install.wim (Operating System Image)
5) Install.wim from source files via an Operating System Image
in PCs with the following configurations:
1) BIOS PC
2) UEFI PC with SecureBoot enabled
3) UEFI PC with SecureBoot disabled
In each scenario, the test was successful and worked. I cannot say what is causing error 0xc000000e, but I would recommend opening a support case if you do continue having the issue.
Frank - Does the WIM need to be captured from a UEFI PC to be deployed to a UEFI system? Or can a reference image created on a gen1 VM or a bios based PC be applied to a UEFI based PC without issue?
I was trying to use the same MDT integrated task sequence and wim that I use for BIOS based PC's, but even if that were an issue, I don't think it explains the 0xc000000e error I'm seeing. The error comes up on first boot after applying the pre-staged image,
when the PC should be booting to WinPE the first time, before it even downloads the task sequence from the sccm server...
I've also created a thread on the technet forums in hopes of finding a solution to this issue. I created a batch script that runs all the steps to apply the prestaged image to a UEFI based PC, so that I could reproduce the results after having tested the
process. I have included the script and related text files in the forum post, just in case I made an error somewhere in the process.
You do not have to build the image on UEFI PC for it to work on UEFI PC. It can be built on a BIOS PC and it will work on a UEFI PC (and the vice-versa is also true). In my test matrix above, all 5 different images were deployed on the 3 different PC configurations
(for a total of 15 tests) and they all worked. I have also used this method with several customers and it also worked for them.
Error 0xc000000e is either:
A device which does not exist was specified.
Not enough storage is available to complete this operation.
This makes me believe that there may be something wrong with the configuration of the BCD Store. You mentioned that you made the Recovery Partition not hidden. According to the TechNet documentation that I used that helped create this article, the partition
needs to be hidden. Is there a reason you are unhiding it? Also does the process work when you don't try to create a Recovery Partition?
I agree that the issue seems like a problem with the BCD store. Unfortunately, I'm not having much luck finding info on how to determine exactly what the issue might be.
I didn't make the recovery partition 'not hidden', I just had to run the "Attributes Volume Set NoDefaultDriveLetter" step before it became hidden or it wouldn't apply.
I did subsequently try the process without creating the recovery partition, and still got the same 0xc000000e error on boot after the prestage media image was applied.
I am not sure what is causing the problem. All I can suggest at this point is opening a case so we can do some in depth troubleshooting. Thanks.