How do I capture a WIM and overwrite an existing imported OS?
-
Wednesday, September 19, 2012 5:38 AM
Hi,
I'd like to automate the process of updating our reference images for our new MDT 2012 Update 1 server. Here's what I've got:
- Task Sequence "Build Windows 8 Image"
- Uses a vanilla "image.wim" to install the OS. Except for the summary page all wizard options are set
- My capture settings are:
ComputerBackupLocation=\\server\share\Operating Systems\Win8_Reference
BackupFile=Custom.wim
Using that path and file name fails and no new WIM is generated. But the task sequence works if capturing to the Captures folder.
When setting this up, I first captured to the Captures folder, and ran through the Import OS process to create seed the Operating Systems\Win8_Reference folder and have MDT update all its xml files. But then when I switched the capture path to as shown above the task sequence fails out every time.
I tried getting around it by making a custom task sequence command that runs 'del /f /q "%DEPLOYROOT%\Operating Systems\Win8_Reference\custom.wim"' just before creating the WIM but I can't get that to work either (maybe I just have the starting path wrong or something?)
I'm open to alternatives if there's a better/right way to do this.
- Edited by BenPeterson Wednesday, September 19, 2012 5:38 AM
- Edited by BenPeterson Wednesday, September 19, 2012 5:43 AM
- Edited by BenPeterson Wednesday, September 19, 2012 5:44 AM
All Replies
-
Thursday, September 20, 2012 1:22 PM
Cant you add any steps after the Capture is complete?
Just add another "Run Command Line" that moves and renames your reference image to the deployroot\operating systems location\reference image?
I also experienced that adressing the %deployroot% and %scriptroot% folders works fine, as long your actions or files reside in that folder. When we go one level deeper it seems to me MDT doesn't know what to do with it and failed.
I tried to execute a script once from the %deployroot%\customscriptsfolder\ location it failed, but when executing it from the %deployroot% folder everything whent just fine.
Keep us posted, and if helpful please rate! Kind regards
-
Thursday, September 20, 2012 7:56 PM
I'll try it out, but if I couldn't use a RunCommandLine to delete the original before hand, I doubt I'll have more success doing a move operation afterward. I'll try things out based on your advice and report back. If it doesn't work, I'll just set a script on a scheduled task nightly that looks for updated images in the captures folder and moves/replaces the existing Operating Systems folder image.
Another concern about my goal that I just thought of - I have linked deployment shares. If I manually replace an Operating System file, I wonder if MDT will know that it's been updated and needs to be replicated out... will check out that and test as well.
-
Thursday, September 20, 2012 8:37 PM
That's indeed another issue. If you can schedule the replication overnight I think it will be possible.
However I recommend the use of DFS-R between shares or a mirror cmd script instead of linked shares, then you know for sure.
Anyway. Good luck!
Keep us posted, and if helpful please rate! Kind regards
-
Thursday, September 20, 2012 10:58 PM
With your help, I figured it all out!
I now capture to the Captures folder and name the WIM file after the task sequence ID. So for example, my "Update Windows 8 General Purpose" task sequence with ID "8_GP" now creates "\\server\DeploymentShare$\Captures\8_GP.wim"
In the Scripts folder on the deployment share I created "Relocate.cmd" with the following contents:
MOVE /Y "%DEPLOYDRIVE%\Captures\%1.wim" "%DEPLOYDRIVE%\Operating Systems\%1"
And finally, I added a step at the end of my task sequences that runs this custom command (no Start in value defined):
cmd /c %SCRIPTROOT%\relocate.cmd %TaskSequenceID%
This works great and MDT does in fact recognize the changed .wim file in Operating Systems and copies it to linked deployment shares, so no worries there.
For anyone trying to recreate this, don't forget that before you build this automated, you have to do it manually one time using the following steps:
1. Capture the OS to the captures folder
2. Run Import Operating System and pull in the captured WIM. For the folder name, make it match the task sequence ID that updates this image file
-
Friday, September 21, 2012 4:48 PM
Hi, thats great. Could you please mark as answer then for recognizing my solution if you'd like?
Thanks
Keep us posted, and if helpful please rate! Kind regards

