• Home  / 

How to use SMS 2003 OSD FP Update and ImageX for System Backup purposes

By arwidmark / April 17, 2007

Welcome


This article describes how to create a package for SMS that will perform a full computer backup of Windows XP. This scenario is not supported by Microsoft.


 Background


This scenario is using SMS 2003 to push out a Windows PE 2005 ISO Image that will connect to the SMS server (DP) and executes a script that start the backup.


Note: The SMS 2003 SP2 Server used in this guide has all SMS roles. The Server name is SRV001 and the domain name is TSLAB. The WinPE version used is Windows 2005 with boot-in-ram. Client computers need to have about 256 MB RAM. All below steps can be performed on SRV001.


The guide covers the following steps


·        Create a custom Windows PE 2005 image


·        Create the SMS Package and scripts that performs the backup


Part 1 – Create a custom WinPE image


1.      On SRV001, copy the WINPE folder from the Windows PE 2005 CDROM to D:\


2.      Rename the D:\WinPE folder to Build_x86


3.      Copy the SAMPLES\SERVERSP1-REMOVELIST.TXT from the Windows PE 2005 CDROM to D:\Build_x86


4.      Edit the D:\Build_x86\SERVERSP1-REMOVELIST.TXT file and remove the following lines

inf\net21x4.inf
system32\urlmon.dll
system32\drivers\dc21x4.sys



Note
: urlmon.dll is required for network support, and the *21×4.* files is for Virtual PC Nic support.


5.      Build a WinPE folder structure by inserting a Windows Server 2003 SP1 CD-ROM (F: in this example), start a command prompt and type (Press Enter after each line):


cd /d D:\Build_x86


mkimg.cmd F: D:\OSD_BACKUP


6.      Reduce the size of WinPE to about 94 MB by creating a batch file named ReduceWinPE.cmd in the D:\Build_x86 folder containing the following lines


cd /d D:\OSD_BACKUP\i386


for /f “eol=;” %%i in (D:\Build_x86\serversp1-removelist.txt) do del /q %%i


7.      Execute the previously created D:\Build_x86\ReduceWinPE.cmd batch file


8.      Copy the Timeout.exe file from C:\Windows\System32 to D:\OSD_BACKUP\i386\System32


9.      Edit and replace the contents of the D:\OSD_BACKUP\i386\System32\startnet.cmd file with the following text:


REM Start networking
regsvr32 /s netcfgx.dll
factory -minint
netcfg -v -winpe
net start dhcp
net start nla


REM Establish network connection to Backup Server
Timeout /T 5
Net Use F: \\SRV001\Packages /user:TSLAB\BackupAccount [email protected]


REM Perform the backup
start /wait cmd /c \\SRV001\Packages\osdbackup\backup.cmd


REM Reboot after backup is completed
Exit


10.   Create a bootable Windows PE 2005 image iso image, by starting a command prompt and type (Press Enter after each line):


cd /d D:\Build_x86


OSCDIMG.EXE -betfsboot.com -n D:\OSD_BACKUP D:\OSD_BACKUP.ISO


 


Part 2 – Create the Package


1.      On SRV001, create a folder named D:\Images and share it as Images.


2.      Create a user named BackupAccount in the domain, assign the BackupAccount user account Modify permissions to the D:\Images folder.


3.      Create a folder named D:\Packages and share it as Packages.


4.      Create a subfolder named D:\Packages\osdbackup and copy the previously created D:\OSD_BACKUP.ISO file to the d:\Packages\osdbackup folder.


5.      Create a text file named Winnt.sif in the d:\Packages\osdbackup folder with the following text:


[SetupData]
BootDevice = “ramdisk(0)”
BootPath = “\i386\System32\”
OsLoadOptions = “/noguiboot /fastdetect /minint /rdexportascd /rdpath=OSD_BACKUP.ISO”


6.      From the D:\OSD_BACKUP\i386 folder (WinPE 2005 structure), copy the following files to D:\Packages\osdbackup.

ntdetect.com
Setupldr.bin


7.      From the C:\Program Files\Windows AIK\Tools\x86 folder (WAIK Install), copy the following file to D:\Packages\osdbackup.

ImageX.exe


8.      In the D:\Packages\osdbackup folder, rename Setupldr.bin to ntldr.


9.      Create a textfile named Prepare.cmd in the d:\Packages\osdbackup folder with the following text.


REM Prepare for new loader
attrib c:\ntdetect.com -h -r -s
ren c:\ntdetect.com ntdetect.old
attrib c:\ntldr -h -r -s
ren c:\ntldr ntldr.old

REM Copy WinPE and new loader
Copy \\SRV001\Packages\osdbackup\OSD_BACKUP.ISO c:\
Copy \\SRV001\Packages\osdbackup\ntdetect.com c:\
Copy \\SRV001\Packages\osdbackup\ntldr c:\
Copy \\SRV001\Packages\osdbackup\Winnt.sif c:\


10.   Create a textfile named Backup.cmd in the d:\Packages\osdbackup folder with the following text.


REM Clean up and reset loader info
del c:\ntdetect.com
del c:\ntldr
del c:\winnt.sif
del c:\OSD_BACKUP.ISO
ren c:\ntdetect.old ntdetect.com
ren c:\ntldr.old ntldr


REM Start the Backup
\\SRV001\Packages\osdbackup\ImageX /capture /compress maximum C:\ \\SRV001\Images\%computername%.wim “Backup”
Exit


Note:  The line after “REM Start the Backup” might have been wrapped and should be added as one line


11.   Create a SMS application package that starts the Prepare.cmd file. Configure the package so that SMS restarts the computer after running the package.


 

About the author

arwidmark