The Deployment Bunny

OS Deployment, Virtualization, Microsoft based Infrastructure…

  • about.me

    about.me/mikaelnystrom

  • Archives

  • Meta

Nice to Know – Switch from ImageX to DISM in MDT

Posted by Mikael Nystrom on May 19, 2014

Be default the capture process in MDT 2013 uses ImageX to capture the image, there is nothing wrong with that, well, it takes time since Imagex takes about 15 minutes or more just to scan the file system before it starts to capture the image and maybe you would like to get rid of that time. That is possible by doing some modification to one of the scripts in MDT so that it starts to use DISM.exe instead

The script that needs to be modified is ZTIBackup.wsf and you can download the updated version here. (Please make sure you have a copy of the previous version so that you can go back for any reason.)

(Important note: I have updated the script since I missed to include settings that will honor the wimscript.ini file, without that the image will not be cleanup from junk and therefore larger. So, if you did download the script and used it, download it once more, since it is now updated)

As a bonus this also fixes the problem to append the wim file to an existing wim file.

How-to?

  1. Download the file from here: http://1drv.ms/1gZICln
  2. Rename the Scripts\ZTIBackup.wsf to ZTIBackup.old
  3. Clear the Internet download flag from the new ZTIBackup.wsf.
  4. Copy the new ZTIBackup.wsf to the Scripts folder.

Done.

/mike

38 Responses to “Nice to Know – Switch from ImageX to DISM in MDT”

  1. And if you ever need the original file from any version of MDT, have a look at http://mdtcustomizations.codeplex.com/SourceControl/latest#Original scripts/Versions/ ;-)

  2. […] Nystrom a écrit un article sur le remplacement de ImageX par DISM dans MDT 2013. Voici une […]

  3. Great site. I have no idea why but my feel after using the script is that it took longer to create the WIM file. Not sure if network traffic can be blamed for it. None the less, thanks for all the great info you provide on the site. Kudos.

  4. John Tracy said

    That’s a great idea, DISM is the imaging tool of today. I definitely had to try it, but I noticed that my captured images are about 500mb bigger after making this change.

  5. […] just to scan the file system before starting. You should switch to DSIM which are much faster. Click here to download the […]

  6. Mikael, I was having a problem when using this script to capture my reference image. When I would deploy them with ConfigMgr, the TS would fail when trying to apply the WIM file. The SMSTSLog file would show “Permission for the requested failed”. After switching back to the default ZTIBackup.wsf script, the TS completed fine. Any idea of what may have caused that?

    • Yes, the first version of the script was “bad”, I published the script that did not use the wimscript.ini file while doing the capture and therefore it left junk in the image that was from the ref image creation process, that is now fixed.

  7. Ashwani said

    ok

  8. Ashwani said

    good.

  9. eric4tenet said

    Can this be used in MDT 2012 Update 1?

  10. Thanks for putting this together. After doing this, though, the progress indicator doesn’t show. It looks like DISM doesn’t output its progress to stdout like ImageX did, so guessing it’s just a limitation of DISM?

  11. Adam Orion said

    When I try to use this script in SCCM, I receive an error from DISM: User profile failed to load.

    Any ideas?

    Thanks!

    • Not really, since I never,ever capture an image using ConfigMgr. I use MDT and LTI for that and deploy using ConfigMgr. That is the recommended way even if you ask Microsoft

      • Adam Orion said

        Recommended by Microsoft. Meh. ;) Well, if someone else comes across the issue and a fix, I would love to hear about it!

      • Or start creating the ref images using MDT since that is the only working solution today. :-)

        Just ask around, it is a pretty common method

      • Adam Orion said

        We’re actually using this to create a WIM backup of a user’s machine coming out of lifecycle in lieu of Symantec Ghost. We build our reference images using VMware or Hyper-V or VHD.

      • ok, well, it should work without any issues, I just never tested it. As long as your WinPE version have DISM in the path it should work

      • Adam Orion said

        Yeah, it’s PE for 8.1 and below so it has DISM in it. The error’s just very odd and does not occur if I run DISM manually via cmd in PE. Not sure why the script would want to try and load a user profile…

    • Diagg said

      Just to let you know : I jhave the very same issue with MDT 2013, Windows 8.1 and Hyper-V … DISM i hate you !!!!

      • Adam Orion said

        Hi Diagg,

        Realize that it has been a while but I decided it was best to ditch VB and this WSF file in my backup routine. Instead, I am using PowerShell and the DISM cmdlet functions. Particularly the new-windowsimage command works wonderfully.

        In my scenario, I built a script to identify the OS partition and assign a variable to it. Then I applied that variable in the new-windowsimage command. Pretty easy and tons faster than using imagex or DISM. It did a 55GB backup in no time compared to over an hour or longer with imagex and the WSF script.

        Good luck!

  12. Phil said

    Hi,

    as this is my first post here i’d like to thank Mikael for his great work that he’s sharing here at deploymentbunny.com.
    In the past, some of your postings litterally safed my day!

    Today i ran over this threat as i was trying to find a way to optimize the WIM image creation process since i am missing the “description” flag at images captures using MDT LightTouch deployment.

    to claryfy:

    running “dism /Get-WIMInfo /WimFile:d:\sources\install.wim” at the orginal Microsoft DVD you’ll getting something like:

    Index: “1”
    Name: “Windows 8.1 Pro”
    Description: “Windows 8.1 Pro”

    Running the same command at my fresh reference image WIM file i get something like:

    Index: “1”
    Name: “REFW8X64-001CDrive”
    Description: “”

    Integrating such a WIM into my original media is causing problems during installation without editing the “Description” field to it’s supposed value using imagex like:

    imagex.exe” /info “mywimfile.wim” 1 “Windows 8.1 Pro” “Windows 8.1 Pro”

    All this wouldn’t be necessary if we’d use MDT also for OS rollout but my department is using ACK from Aagon instead. This solution unfortunately can´t handle wim files directly and therefore always needs the full set of files according to the original windows dvd.

    Do you have any idea on how set the “Name” and “Description” value while running ZTIBackup.wsf ?
    I just tried your ZTIBackup.wsf version but it doesn’t set the values eather. Besides, it is unfortunately also not setting the “FLAGS” value.

    Best,
    Phil

  13. jf4x said

    Is there any benefit to switch imagex when applying image to new machine? I think MDT uses images to write image.

    • You save around 15 minutes of the capture process when capturing Windows 8/Server 2012 and above. Imagex spends 15 minutes trying to figure out the new file system before it starts the capture

  14. jf4x said

    No edit button :) Any benefits switching imagex to dism when applying image to new machine? I think MDT is using imagex when applying image file to new machine.

  15. Rab said

    This worked without any problems what so ever. Yhank you verry much indeed!

    A question thoe.

    Woud there be any gains to use this aproach to deploy the captured image?
    Or to clearify futher. Can one substitute ImageX with DISM when deploying and is there any gain in that? And lastly is there parhaps a script to download ready made for this scenario?

    /Rab.

  16. […] If you haven’t already done so, create a second VM to serve as the client. Assign two virtual processors and at least 4GB of RAM to the machine. These two items alone may shave 20-25 minutes off the build and capture time. If you want to save additional time, consider booting the VM from a RAMDisk and changing the capture process from ImageX to DISM. […]

  17. John M said

    Looks like this is no longer need in MDT 2013 Update 2, the ZTIBackup script is calling DISM.exe instead of ImageX

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

 
%d bloggers like this: