One of the limitations of SCCM is the use of Imagex. When you want to capture an image of a computer, this computer needs to be syspreped before capture, or the capture process will fail.
To do a capture of a reference image before sysprep, you normally would have to create a separate WinPE and run ImageX from that. This is also the case if you want to backup a system.
So once again MDT comes to the rescue⌠By using the ZTIBackup.wsf script, you not only get to run ImageX from a Task Sequence, you also utilize the Append part of ImageX, which lets you add images to already existing images, only adding changes.. By taking advantage of that you can add a new reference image to already existing one, and the size will only increase with the changes.
Another benefit is the speed with witch the image is created. Because all the general Windows files are already captured in the initial image, only the changes will have to be captured..
So how is this done then–
1. You will have to integrate MDT into SCCM
3. Create the Task Sequence
Thank you this is really helpfull and works like a sharm!.
I added one step before the toolkit package to reboot the computer in Winpe.
When I run I keep getting Input Error: There is no script engine for file extension “.wsf””. Command line returned 1Entering ReleaseSource in WINPE
Any update to this, i’m also getting
“There is no script engine for file extension â.wsfâ”. Command line returned 1Entering ReleaseSource in WINPE
To you guys with the extension problem.. try and remove all quotations so the command-line reads
cscript.exe %ScriptRoot%ZTIBackup.wsf
I noticed on other MDT integrated task sequences I’ve created, whenever it needs to run a script, it uses: “cscript.exe “%deployroot%scriptsztiprereq.vbs”” %deployroot% instead of %scriptroot%, where is %scriptroot% and %deployroot% actually pointing to on the sccm server? can you change the values of those variables or are they hard-coded?
I finally got your script to work (prompt for backup wim image name in the OSD)
—script begin—
set env = CreateObject(“Microsoft.SMS.TSEnvironment”)
Set ProgressUI = CreateObject(“Microsoft.SMS.TsProgressUI”)
ProgressUI.CloseProgressDialog
BackupFile = InputBox(“Name of wim file”)
env(“BackupFile”) = BackupFile
—script end—
What I had to do was:
1. create a new package with just a source directory pointing to my scripts on my sccm server.
2. add a ‘Run Command Line’ TS after ‘Set Backup Wim File’ called ‘Name Backup Wim File’ with the command line: cscript.exe “namewim.vbs” and with ‘Package’ checked and my new scripts package selected. Now my capture only TS prompts for the wim image name. I am sure I could prompt for the image destination as well.
When I tried running it any other way, my capture TS failed with an invalid function error 0000001 or something like that.
Thanks for your contributions Michael.
Just glad i can help…
For the answer to your other question,%deployroot%, a hope i answered it on technet http://social.technet.microsoft.com/Forums/en-US/configmgrosd/thread/2628afbd-cd06-46a8-a875-e96a339ecee2/#7810986f-22ae-4c34-af97-0ea2ea0fb126
And Terry, please mark the Technet post as answer, so others can see it helped..
Michael
When you say “remember it must be run from the Boot image” what exactly do you mean? Do you mean that I need to add a step in the TS to boot from the boot image? So I would just add that right before the “Use Toolkit Package” step? If not would you be able to export and post your TS to be downloaded? Then I can just substitue my Toolkit Package and backup share location information? That would really be of great help. Thank you.
hello Michael ,
can you explain refresh scenario from xp to 7 Using USMT 4 hardlinks , like what are the commandline and what does it mean ,, what we need from the toolkit package and which scripts are run ,, customizing unattended.xml , is it possible , Thanks alot
Thanks Michael,
wonderful post. It was a good idea to create an own topic for that.
You are doing a good job, dude!
Thanks
I have a question. Can I use the same sequence for a syspreped image?
I want to create a custom image with a task sequence in SCCM. Since this task simply create the image and that I have did a sysprep manually.
Thanks
You certainly can, It will use Imagex to capture whatever is on the HD!
Thanks Michael for opennig this post is great,I have a question if i backup many computers using a specific image name and the ZTIBackup.wsf script, how coud I restore a specific computer ? is there a way to do that thanks
I’m responding a bit late, but perhaps like me someone else will come across the need to automate the restoration process. Much is identical to above, and we can reuse the .vbs file from comments above to specify name of .wim
Step 1: Use Toolkit Package
Step 2: Connect to network Folder step – specify a share letter and username for the image backup directory.
Step 3: Set Backup File Name – Can use the .vbs script from comments above to prompt for the .wim name to restore during the osd process. My command line contains: cscript “namewim.vbs” and I have created a separate package that holds it (had little luckerrors when including it in mdt files package) Here’s the script:
âscript beginâ
set env = CreateObject(âMicrosoft.SMS.TSEnvironmentâ)
Set ProgressUI = CreateObject(âMicrosoft.SMS.TsProgressUIâ)
ProgressUI.CloseProgressDialog
BackupFile = InputBox(âName of wim fileâ)
env(âBackupFileâ) = BackupFile
âscript endâ
Step 4: Restore Image – Run Command Line step. If for example in step 2 you used the V: drive it would read:
%DeployRoot%toolsx86imagex.exe /apply V:%BackupFile% “1” c:
Hi Michael ,
I use the ZTIbackup.wsf file , but I want to capute the image to a random (Shortest) SCCM DP or use the SMP to store the image .
It should be possible thru MDT , but I cannot get it working with the SMP . Any expierences or thoughts ?
Greatings ,
Kenny
This works great for me but what about if I have more than 1 partition on the same drive and want them both? For example I have a C drive with all my data and then an E drive which is for the pagefile. It looks like following the steps above only grabs the C drive. How do I grab both C and E so I can deploy the same configuration to my computers? Thanks!
Do you know if we could use this method to capture Windows 8 Customer Preview?
Since using the “normal” TS capture doesnt work.
(Gives us error msg: Unable to sysprep the machine, hr=d000004 / Syspreping the machine failed, hr=d000004
/ Failed to run the action : Prpare OS. The system cannot open the file (error 00000004: Source Windows) )
Thanks
Hi
The task sequence is successfully started image backup, but it didnt confirm after the backup completion, i.e. keep running on … no message or restart for after the completion, pleaes advice.
I am running the Task Sequence as you’ve detailed above however the Capture is failing at 25% with the following messages in the ZTIBackup_imagex.log file:
[ ERROR ] C:Program FilesMicrosoft SDKsWindowsv7.1Binvsstoolsxdr-schema.xsl (Error = 32)
[ ERROR ] C:Program FilesMicrosoft SDKsWindowsv7.1Binvsstoolsxdr-schema.xsl (Error = 32)
Error imaging drive [C:]
The process cannot access the file because it is being used by another process.
ZTIBackup.log is showing the following messages:
About to run command: cmd /c “”C:_SMSTaskSequenceWDPackageToolsx86imagex.exe” /capture /compress maximum C: “\servernameImageX_BackUpXXXXX-XP.wim” “201203261628CDrive” >> X:windowsTEMPSMSTSLogZTIBackup_imagex.log 2>&1″
ZTI Heartbeat: command has been running for 78 minutes (process ID 1180)
Return code from command = 2
Error creating an image of drive C:, rc = 2
ZTIBackup COMPLETED. Return Value = 2
Property BackupScriptComplete is now = YES
ZTI ERROR – Non-zero return code by ZTIBackup, rc = 2
The task sequence is running from within WinPE and the Command Line is calling: cscript.exe %deployroot%scriptsZTIBackup.wsf
Please let me know if there are any tweaks that can be made to get around this.
Thanks,
Scott
This works really good. Cudos to you. The only question I have is I want to incorporate this process into our production windows 7 image because data is pretty critical. I am receiveing 0x00000005 errors. Is there an additional step I need to add to accomplish that?
Jason, have you had any luck with adding this to your production windows 7 image, I’m getting the same error. The backup wim is created fine but then get the 0x00000005 error after that, I added the backup steps before a functioning win 7 deployment. If I remove the backup part the process works as it did before, but add them back and it fails. Any help would be appreciated.
I just found the following: http://social.technet.microsoft.com/Forums/en-US/configmgrosd/thread/d89cefda-bf76-447c-9569-41ce475f20e1
It worked great for me, remove the diskpart step as indicated in the post. It appears there are some log files created when the backup image is created and the diskpart step is denied access. SCCM will perform a wipe when installing the new OS.
I’ve followed your instructions to capture a machine that I’ve built and sysprepped manually. The MDT task sequence gets as far as the Create Image command and then fails. The WinPE error message that comes up says “error code 0x00000001”, and I can’t find anything else helpful other than a ZTISCCM.log that says “Property OSDTargetDriveCache is now = DIRTY ZTISCCM 11/8/2012 1:24:49 PM 0 (0x0000)” and “DestinationDisk and Partition did not yield a target Partition. ZTISCCM 11/8/2012 1:24:49 PM 0 (0x0000)”
SMStslog reports an “incorrect function”.
Any idea what’s going wrong?
Nevermind, just figured it out. Can’t blame it all on you đ (because I should have been reading more carefully), but I was missing a % on the %scriptroot%– if you look at your (extremely helpful) documentation above, the 7th row in your table of steps says (to the right of the picture):
“In the Command line: type in
cscript.exe
â%scriptrootZTIBackup.wsfâ
”
Your screenshot shows the proper verbiage with both % around the “scriptroot”, but the written instruction is missing the %. I copy-pasted what you had written there and so made a typo…
thank you so much for this thread it’s helped me immensely!
I need to capture a complete image on a source computer before I sysprep my image. You mention that Imagex will do that and that is what I have been trying to use. Every tutorial I have read, including the one on Microsoft’s site tell me to boot to WinPE and run Imagex which I do. Nowhere does it say to use the /boot switch if the image is a full backup image and it needs to replace everything on the target computer. Whether I use the /boot switch or not the image will not boot on the target computer. It reports that the operating system can not be found. The files are placed on the drive but it will not boot. A couple of forum posts and one web site tell me that I need to run BCDEdit but if I try to do that then BCDEdit errors out with a can not find configuration data store error. This seems to be consistent. I need to capture this image and also capture the sysprepped image later but I get the same results. If I run Diskpart and clean the drive prior to applying the new image then it will not boot. If I do not clean the drive first ImageX goes through the motions of applying the image to the target but it is unchanged when done. One forum post said that I can not apply an image to a clean drive because it does not have the “system reserved partition” present. If that is true, why doesn’t ImageX create that partition if it is required for a drive to be bootable? You ask why I do not use active directory and SCCM and WDT to automate this. It is because we are not on Microsoft and I am trying to find a Ghost alternative.
Thank you.
Hello,
I have followed all the instructions but when running the command line it fails?
I have tried numerous things that others have asaid above but have not had any luck it is the 0x00000001 error
Thanks
James
Hello All,
Thought I’d chime in. I kept receiving the 0x00000001 error but fixed it by placing cscript.exe in the boot image. It was not there previously.
Issue now is that I am receiving ztibackup cannot find the file specified.
I know this post is a bit dated DAOV, but hoping someone might still be out there. Trying to get this to work but getting the same file not found error in the logs when trying to run this capture. Any suggestions would be greatly appreciated. Thanks in advance.
[…] Capture none syspreped image using SCCM (Running imagex … â One of the limitations of SCCM is the use of Imagex. When you want to capture an image of a computer, this computer needs to be syspreped before capture, or the …… […]
FYI, if you are copy/pasting cmd lines…cscript.exe
â%scriptrootZTIBackup.wsfâ should read cscript.exe
â%scriptroot%ZTIBackup.wsfâ
missing a % in the variable
Thank you for this one. I haven’t done an imageX sysprep capture since Windows 7 and that was using Altiris. With the release of W10 I’d been struggling to practice SOE deployments with W10 via SCCM2012 but this finally guide made it possible. Fortunately MDT had already been integrated. Now to further customise the deployment and toying around with Group Policy Preferences. Thank you again.