Академический Документы
Профессиональный Документы
Культура Документы
7 SP2
OS Deployment of Windows XP Using WinPE
Best Known Method
Revision 1.0
Jared Barneck
February 26, 2007
Information in this document is provided in connection with LANDesk® products. No license, express or
implied, by estoppel or otherwise, to any intellectual property rights is granted by this document. Except
as provided in terms and conditions for such products, LANDesk Software, Inc. and its affiliated entities
(“LANDesk”) assume no liability whatsoever, and LANDesk disclaims any express or implied warranty,
relating to sale and/or use of LANDesk products including liability or warranties relating to fitness for a
particular purpose, merchantability, or infringement of any patent, copyright or other intellectual
property right. LANDesk products are not intended for use in medical, life saving, or life sustaining
applications. The reader is advised that third parties can have intellectual property rights that can be
relevant to this document and the technologies discussed herein, and is advised to seek the advice of
competent legal counsel, without obligation of LANDesk.
LANDesk retains the right to make changes to this document or related product specifications and
descriptions, at any time, without notice. LANDesk makes no warranty for the use of this document and
assumes no responsibility for any errors that can appear in the document nor does it make a commitment
to update the information contained herein.
LANDesk, Peer Download, Targeted Multicast, and Trusted Access are registered trademarks or
trademarks of LANDesk Software, Ltd. or its affiliated entities in the United States and/or other
countries.
Avocent is a registered trademark of Avocent Corporation. Other brands and names may be claimed as the
property of others.
2
Table of Contents
Introduction ................................................................................ 5
Scope ........................................................................................ 5
Assumptions ................................................................................ 5
Step 1 – Creating a Source Image ...................................................... 6
Sector by Sector Imaging ............................................................. 6
Common Mistakes When Imaging Windows XP with WinPE ...................... 6
Mistake 1 - Using the Wrong Version of Windows XP ......................... 6
Mistake 2 – Building the Image on a Partition that Fills the Entire Drive . 7
Mistake 3 – Installing Applications that Change or Upgrade Often ......... 7
Mistake 4 – Installing the LANDesk® Agent on the Source Image........... 7
Mistake 5 – Deploying Images without Using Sysprep ........................ 7
Basic Process for Building a Windows XP Image................................... 7
Step 2 - Creating a WinPE Capture Script ............................................ 9
Step 3 - Configuring the PXE Boot Menu............................................ 12
Step 4 – Configuring and Installing the PXE Representative.................... 13
Pre-configuration of the PXE Representative.....................................13
Pre-configuration Step 1 – Changing the F8 Menu Prompt and Timeout .13
Pre-configuration Step 2 - Configuring Name Resolution in the WinPE
Image ...........................................................................14
Post-configuration Step 3 – Adding Drivers to the WinPE Image ..........15
Installing the PXE Representative ..................................................19
Post-configuration of the PXE Representative ...................................24
Post-configuration - Configuring the Firewall ................................24
Step 5 - PXE Booting to WinPE and Capturing an Image......................... 24
Step 6 - Creating a WinPE OS Deployment Script................................. 30
Step 7 – Adding the OS Deployment Script to the LANDesk® Boot Menu .... 38
Step 8 – Preparing a Workstation to Be Imaged ................................... 39
BIOS Configuration ....................................................................39
Naming the Workstation in the Inventory Database .............................39
Step 9 - PXE Booting to WinPE and Deploying the Sysprepped XP Image.... 40
Summary .................................................................................. 42
Appendix A – Troubleshooting the PXE Representative Deployment Script 43
Appendix B – WinPE Troubleshooting ............................................... 44
Troubleshoot Boot Failures ..........................................................44
Opening a Command Prompt and Using Available Tools ........................44
Adding a driver to WinPE ............................................................45
3
Appendix C – Troubleshooting a WinPE OS Deployment Script ................ 46
OS Deployment Scripts Explained ..................................................46
[VALUES] Section..................................................................46
[OWNER] Section ..................................................................46
[JOBPARAMS] Section.............................................................46
[MACHINES] Section...............................................................47
Sample WinPE Capture Script from 8.7 SP2.......................................47
WinPE Capture Script Dissected ....................................................48
Sample WinPE Deployment Script from 8.7 SP2..................................49
WinPE Deploy Script Dissected......................................................52
Reading Logs Results of an OS Deployment Script ...............................56
Appendix D – Custom Modifications to an OS Deployment Script ............. 56
New Requirement for Making a Custom Modification to an OS Deployment
Script................................................................................56
Adding Commands to the End of an OS Deployment Script ....................57
Appendix E - WinPE and ImageW Feature Matrix ................................. 58
Appendix F - ImageW.exe Command Line Switches ............................. 59
4
Introduction
WinPE is a new PXE boot option with LANDesk Management Suite 8.7. Because
it is based on Microsoft technology, it requires a license. Contact your LANDesk
Sales Engineer to obtain Licensing for WinPE.
WinPE is not XP and it is not Vista, however, it is an operating system and still
requires drivers. Drivers built for Windows XP should be valid for WinPE. It is
possible that Vista drivers will be valid as well.
Scope
This document discusses the use of WinPE for OS Deployment of Windows XP. It
will cover the following topics. For best results, read and complete each
section in the order listed:
• Creating a Source Image
• Creating a WinPE Capture Script
• Configuring the Boot Menu
• Installing the PXE Representative
• PXE Booting to the WinPE Menu and Capturing an Image
• Creating a WinPE OS Deployment Script
• Adding the Deployment Script to the LANDesk Boot Menu
• Preparing a Workstation to Be Imaged
• PXE Booting to the WinPE Menu and Deploying the Image
Assumptions
This document discusses basic administrative tasks involving Management Suite
process used for OS Deployment. It assumes that a Core Server is already
installed and that a DHCP server is already working in the current environment.
It is assumed that the reader is familiar with the process of installing the
necessary operating system and preparing it to be imaged.
The minimum equipment needed is the following three computers:
• Core Server
• PXE Representative
• Test machine: for capturing and deploying an image
However, this document assumes the need for two more machines:
• Separate file server: Machine on which the captured images are written
to and stored
5
• Second test machine: Machine on which the image is deployed
Note: For testing and writing this document, both physical workstations
and VMWare 5 virtual machines were tested.
For this document, it is assumed that a single partition Windows XP Sysprepped
image is captured and deployed.
6
Mistake 2 – Building the Image on a Partition that Fills the Entire Drive
As mentioned earlier, Image is a sector by sector imaging tool. It can only be
deployed to a hard drive with the same amount of sectors as the source
partition had when the image was captured. Installing Windows XP on a
partition that fills the entire drive limits the images ability to deploy drives
that may be smaller. The image should be created on a partition that is smaller
than the smallest hard drive the image will be deployed to.
7
4. Create a partition that is smaller than the smallest drive to which the image
will be deployed. Leave the rest of the disk unpartitioned. (Usually 10 GB to
15 GB is sufficient.)
5. Use the default networking components. Do not join a Domain during the
installation.
Warning: Joining that domain could result in undesired policies included
in the image. Such policies may prevent the automation of the
imaging process or result in an unstable image. For best result,
make the device a member of a workgroup.
6. Finish the installation of Windows XP.
Warning: If the volume license version of Windows XP was used, the
installation does not prompt for activation. If the installation
prompts for activation, stop building the image and obtain the
volume license version of Windows XP and reinstall.
7. Log on as the local administrator.
8. Make any changes to the Image, including driver installation and software
installation of any application that has been chosen to be included in the
image.
Warning: It is recommended that most software be installed after the
imaging process using Management Suite’s Software
Distribution. If software is installed manually on the image, be
aware that some software requires access to the installation
source during normal runtime or when a new user first logs on.
Microsoft Office is an example of such software. Any software
that requires access to the installation source should be
installed from a network resource that will be available after
the image is deployed. Installing such software from a CD is not
recommended.
9. Download the correct version of Sysprep and run it. Check the Mini-Setup
checkbox and choose to shut down the machine when Sysprep finishes.
For more information see the LANDesk KB Article 2502 - LANDesk Sysprep
Whitepaper. http://kb.landesk.com/article.asp?article=2502&p=5
Warning: Failure to use Sysprep may result in a windows environment
not supported by Microsoft.
http://support.microsoft.com/?kbid=162001
10. Leave the machine turned off.
11. The Machine is now ready to be captured but the actual capture process will
not occur until Step 5 - PXE Booting to WinPE and Capturing an Image.
Please continue with Step 2 - Creating a WinPE Capture Script before
moving on. Each step should be completed in order.
8
Step 2 - Creating a WinPE Capture Script
How to create a WinPE Capture Script:
1. Open the Management Suite Console and click Tools | Distribution | OS
Deployment.
2. Right-click My Scripts and click New Windows PE Configuration.
3. Click the Capture Image radio button (in this case it is already selected)
and click OK.
9
6. Click to highlight Credentials.
10
should be given on the Sharing tab by clicking Permissions and
also under the Security tab.
14. Type the path to the ImageW.exe file and include the file name in the
Enter the UNC path to the imaging application field.
15. Verify that the server name uses a value that can be resolved to an IP
address in WinPE. The server’s hostname, FQDN, or IP Address can be used
here.
\\CoreServer\ldmain\osd\imaging\imagew.exe
Note: Write access is needed to this share.
The command line for the imaging tool appears in the LANDesk
Management Suite window.
Note: The process for capturing and image using Image requires
backall.bat, ImageAll.exe, and ImageW.exe. Notice the command
line actually calls backall.bat and not ImageW.exe directly.
11
17. Click OK.
The desired switches are preconfigured to capture the all partitions on the
first drive. For this example, do not make any changes.
6. Click the Update toolbar icon (the last icon on the right) to commit the
changes.
12
Step 4 – Configuring and Installing the PXE
Representative
A PXE Representative is a bootp server, which is similar to a DHCP server
except it returns instructions for network booting instead of IP Address
information. See RFC 951 for more information on the bootp protocol.
http://www.ietf.org/rfc/rfc951.txt
In order for a device to PXE boot, the DHCP request from a workstation must
reach both the PXE Representative and the DHCP server. Usually the PXE
Representative is a workstation on the same subnet as the workstation that is
to be PXE booted.
For this quick start guide, choose a computer that is on the same subnet as the
machine being captured.
Note: The PXE Rep can be installed on Windows 2000 Professional,
Windows 2000 Server, Windows XP, Windows 2003 Server, and
Windows Vista. The LANDesk Agent must already be installed to
the device.
13
4. Click OK when finished.
Pre-configuration of the PXE Representative is complete.
14
How to add a hosts file to the WinPE image:
1. Before making any changes to the LDVPE1.img, always back it up. Make a
copy of LDVPE1.img called LDVPE1.img.original.
2. Create a hosts file using a text editor. Make sure it is named hosts with no
file extension. A sample two line hosts is demonstrated below.
192.168.0.1 CoreServer CoreServer.Domain.com
192.168.0.1 ImageServer ImageServer.Domain.com
cd C:\Program Files\LANDesk\ManagementSuite\LANDesk\VBoot
6. From the Vboot directory type the following command to copy the hosts
file into the LDVPE1.img.
15
good idea to add the date each time this file is backed up and
maintain multiple backups at different stages of modification.
2. From the Network View, click Tools | Distribution | OS Deployment.
3. Click the Add Driver toolbar icon.
4. The path should already appear or a new patch to the LDVPE1.img file can
be entered. Use the direct path if working on the Core Server:
C:\Program Files\LANDesk\ManagementSuite\LANDesk\Vboot\LDVPE1.img
or use the UNC path if using a Remote Console:
\\CoreServer\ldmain\LANDesk\vboot\LDVPE1.img
If adding a driver for a drive controller, such as a SCSI or SATA controller,
click the first radio button: OEM driver for SCSI or SATA hard drive.
16
If adding a driver for a network card, or any hardware other than a driver
controller, select the second radio button: Non-OEM driver.
5. For this example, the Marvell Yukon network card is added. Click to select
Non-OEM driver.
6. Click Next.
7. Enter the Path to the driver’s .inf file or browse to it.
8. Enter the Path to the driver’s .sys file or browse to it.
9. If the driver depends on other files, click Add.
10. Browse to the additional files that the driver depends on. Select all the
additional files that are needed. Use Ctrl + click to highlight multiple files.
11. Once the files are highlighted, click Open. The files are added to the Files
this driver depends on list.
17
The following window prompts for Free space to leave in image after
adding this driver. The LDVPE1.img file must contain free space in order to
function properly.
13. For the Free space to leave in image after adding this driver, enter 10.
14. Click Finish.
18
15. Repeat this process for each driver that must be added.
Pre-configuration of the PXE Representative is complete.
19
4. Click and drag the LANDesk Agent workstation from All Devices in the
Network View and drop it on the PXE Representative Deployment task.
5. The device now shows up as a target for the task with a status of Waiting
and a result of Not Specified.
20
6. Right-click the PXE Representative Deployment task and click Start now.
21
If the task was started from a Remote Console, similar information can be
seen by right clicking on the PXE Representative Deployment task and
clicking Current Status. The following window is displayed.
22
7. Once completed successfully the task displays the status of Done and a
result of Successfully completed installation of package.
23
Post-configuration of the PXE Representative
Once the PXE Representative is deployed, the following post-configuration
steps may need to be performed.
UDP Port 1758 PXE Rep Æ Client PXE MFTP Client port
UDP Port 1759 Client Æ PXE Rep PXE MFTP Server Port
UDP Port 4011 Client Æ PXE Rep Unicast bootp. (Only used if the DHCP server tells the client
to use it.)
24
Do not try to PXE boot the PXE Representative. The PXE Representative must
be installed on a device other than the device that is to be PXE booted.
How to PXE boot a workstation and run the WinPE Capture script:
1. Configure the BIOS to have PXE booting enabled.
2. Set the boot order to attempt to boot using PXE first.
3. The next time the machine boots it will attempt to PXE boot as shown
below.
Note: Different network cards may have a slightly different output than
that shown below.
If the PXE Representative was correctly installed on the same subnet as this
device and a DHCP server is available, a prompt to press F8 is displayed. By
default this prompt is displayed for the optimal setting of four seconds.
25
Note: If this menu does not appear, PXE troubleshooting should be done.
If needed, contact LANDesk support.
5. Scroll down and select LANDesk(R) WinPE Menu.
6. Press Enter.
26
Once downloaded the device begins to boot to WinPE.
WinPE then loads and starts running through the Factory Preinstallation
process.
The IP address is obtained from DHCP and connection to the Core Server is
verified.
27
When the booting process completes, the PxeMenu screen appears.
28
9. Double click WinPE Capture.
The PxeMenu closes and WinPE enters a state where it is waiting for
commands to be sent to it from the Core Server. Nothing more is displayed
to the screen until the imaging process begins.
Note: If the imaging process does not begin, see the LANDesk KB Article
1889 – Troubleshooting the PXE Boot Menu hanging at "Waiting for
Command". http://kb.landesk.com/article.asp?article=1889&p=5
If no errors occur, the imaging process begins. The following DOS box
appears.
29
The progress bar displays the progress until the capture is successful. The
computer is rebooted and the image is successfully captured.
This step to PXE boot a workstation and run the WinPE Capture script is now
complete.
30
3. Click the Deploy Image radio button.
4. Click OK.
31
7. Click to highlight Methods and credentials.
32
10. Click to highlight Image type and path.
Make sure the server name uses a value that can be resolved to an IP
Address in WinPE. The server’s hostname, FQDN, or IP Address can be used
here.
12. Enter the path to the imaging tool.
Make sure the server name uses a value that can be resolved to an IP
Address in WinPE. The server’s hostname, FQDN, or IP Address can be used
here.
33
In this example advanced multiprocessor options are not used. No changes
need to be made on this window.
14. Under Sysprep options, click to highlight Image settings.
34
19. Click to highlight Network credentials.
This is based on the MAC Address. Only uncheck this if the workstation
exists in the LANDesk inventory database but is to receive a different name.
35
24. Type the naming convention to use if the device is not in inventory or if the
inventory is not going to be used.
Note: In the example, Sales-nnn is used. This causes each machine to be
named Sales-001, Sales-002, Sales-003, etc. This number value is
stored on the Core Server in the registry and can be manually
changed. The registry key is
HKLM\Software\Intel\LANDesk\LDWN\CustJob\Sales-nnn and the
DWORD name is ComputerNameRuleCount.
36
The LDLOGON share will be accessed by the commands in the GUIRunOnce
section of the Sysprep.inf. These commands process using the workstations
local administrative account not an Active Directory account, so the share
may not be accessible without credentials.
28. Type the password that has access to the LDLOGON share in the Password
field.
29. Retype the password in the Confirm password field.
37
Note: Notice that ImageW.exe is called in this example instead of
Restall.bat. If a multi-partition image were being deployed,
Restall.bat would be called instead of ImageW.exe.
31. Click OK.
The Deploy script is now created and should be displayed in the Operating
system deployment window under My Scripts.
The PXE Boot Menu should look similar to the following figure.
3. Click the Update toolbar icon (the last icon on the right) to commit the
changes.
38
Step 8 – Preparing a Workstation to Be Imaged
Preparing a workstation to be imaged involved the following two steps.
• Configuring the workstation’s BIOS to enable PXE booting (BIOS may
already be configured).
• (Optional) Importing the workstation’s MAC Address and computer name
into the Inventory database.
This first is required, but the BIOS may already be configured.
The second step is optional, but recommended as it saves a lot of man hours
used to rename computers if the computers are named correctly by the
imaging process.
BIOS Configuration
If the workstation is bare-bones, it is required that the BIOS be configured to
enable PXE booting, and it is recommended that PXE booting be first in the
boot order.
If the workstation is coming from a third party vendor, a request can be made
to the vendor to set the BIOS settings so that PXE is enabled and that PXE is
first in the boot order.
39
Once the workstation’s MAC address and computer name are entered into the
Inventory database, the workstation is automatically given the proper name
after deploying a Sysprepped image.
5. Click to highlight the WinPE Deploy Sysprepped XP script and press Enter.
The PxeMenu closes and WinPE enters a state where it is waiting for commands
to be sent to it from the Core Server. Nothing more is displayed to the screen
until the imaging process begins.
6. The imaging process should begin.
Note: If the imaging process does not begin, see the LANDesk KB Article
1889 – Troubleshooting the PXE Boot Menu hanging at "Waiting for
Command". http://kb.landesk.com/article.asp?article=1889&p=5
If no errors occur, the imaging process begins. The following DOS box
appears.
40
The imaging process continues and displays a progress bar until it
completes.
WinPE returns to the state where it is waiting for commands from the Core
Server.
Any tasks that must occur after the image is deployed, but before the
device is rebooted, occur now.
These tasks include dynamically setting the computer name in the
Sysprep.inf, injecting the Sysprep.inf file into the newly imaged hard
drive, and expanding the partition to fill the entire drive.
This screen may flash as each command completes.
41
Once these tasks are complete, the device reboots.
As the machine boots back up, it will do the following automatically:
• Run through mini-setup. This uses the Sysprep.inf file to automatically
name the computer, join it to the correct domain and OU, enable
autologon, configure the GUIRunOnce commands, and reboot again.
• The Sysprep folder is deleted by the Sysprep process which is important
as the Sysprep.inf contains usernames and password in clear text.
• Automatically logon as the local administrator.
• Run the GUIRunOnce commands. LANDesk adds four commands to the
GUIRunOnce by default. For security, it is important to note that while
these commands run, the machine is not accessible.
− The first of these commands runs an ldsleep.exe command to
allow the services to finish loading.
− The second commands maps a drive the LDOGON share on the
Core Server.
− The third command installs the LANDesk Agent, without starting
any LANDesk services, and sets the device to reboot.
− The fourth command disconnects the mapped drive.
• Reboot (caused by the LANDesk Agent installation). This reboot is
important for security to prevent the machine from remaining logged in
as the local administrator.
• Boot up and load the LANDesk services.
• Run any extra commands added to the end of the OSD Script.
• Run any task configured to run in the LANDesk Agent using the Local
Scheduler services, including and inventory scan, Policy-based delivery
(Software Distribution), and/or a Security Scan.
The imaging process is now complete.
Summary
In this quick start guide, the following steps should have been completed in
order.
• Creating a Source Image
• Creating a WinPE Capture Script
• Configuring the Boot Menu
• Installing the PXE Representative
• PXE Booting to the WinPE Menu and Capturing an Image
42
• Creating a WinPE OS Deployment Script
• Adding the Deployment Script to the LANDesk Boot Menu
• Preparing a Workstation to Be Imaged
• PXE Booting to the WinPE Menu and Deploying the Image
[MACHINES_95]
SETSTATUS=1240, ERR
[OWNER]
TYPE=OSDOTHERS
43
REMEXEC1 through REMEXEC5 downloads the boot image files needed for the
PXE Representative installation.
REMEXEC6 downloads and runs the OSDRep.msi, which is the PXE
Representative installer.
REMEXEC7 runs and inventory scan.
The [MACHINES_95] section is only processed if the workstation’s OS is
Windows 95/98/ME. The PXE Representative is not supported on such operating
systems and the deployment is forced to fail using SETSTATUS.
The [OWNER] section is used by the LANDesk Console and is not explained
here.
Common failures may occur if the PXE Representative does not properly get
uninstalled by the first line.
44
ipconfig
3. To verify that the drive was detected, type the following in the command
prompt:
diskpart
This enters the DISKPART> prompt. At the DISKPART> prompt type the
following:
list disk
4. To open Task Manager type the following in a command prompt:
taskmgr.exe
5. To map a drive, type the following in a command prompt:
ping CoreServer
7. To see what ports are open, type the following in a command prompt:
netstat –a
Other tools are available by default and even more can be added or launched
from a network share.
45
related to the way IRQs are used when booting WinPE over the network. Such
issues cannot be resolved by LANDesk. Workarounds include disabling the
problematic network card and using a different network card or using the BIOS
to force the network card to use a different IRQ.
[VALUES] Section
The [VALUES] section is for use when editing the script in the Management
Suite Console. When a script is edited, the values in the Console are derived
from those in the [VALUES] section. Each value corresponds to a field in the
GUI.
[OWNER] Section
The [OWNER] section is mostly for use by Management Suite Core Server as
well as the LANDesk Boot Menu.
If the script is to be edited manually, add CREATEMANUALLY=TRUE to this
section.
[JOBPARAMS] Section
This section is for settings that are global for the entire custom script. For
example, ABORT_ON_CMD_FAILURE=1 affects all lines not just one. It means
that if any line in the script fails, the entire task fails and the task aborts.
46
[MACHINES] Section
This section contains the tasks that are to be run on the Machine.
Before troubleshooting either an OS Deployment capture or a deploy script, an
understanding of the script is necessary.
47
REMEXEC9=<qt/>%LDMS_CLIENT_DIR%\sdclient.exe<qt/> /f /o
/dest="C:\ldvpe1.img"
/p="http://%CUSTJOBHOSTIP%/landesk/vboot/ldvpe1.img"
REMEXEC10=<qt/>%LDMS_CLIENT_DIR%\sdclient.exe<qt/> /f /o
/p="http://%CUSTJOBHOSTIP%/landesk/vboot/tokreplw.exe"
REMEXEC11=<qt/>%LDMS_CLIENT_DIR%\sdclient.exe<qt/> /f /o
/dest="%LDMS_CLIENT_DIR%\ldiscan.cfg"
/p="http://%CUSTJOBHOSTIP%/landesk/vboot/guid.pds"
REMEXEC12=<qt/>%LDMS_CLIENT_DIR%\tokreplw.exe<qt/>
<qt/>%LDMS_CLIENT_DIR%\ldiscan.cfg<qt/> DEVICEID=%Computer -
Device ID%
REMEXEC13=<qt/>%LDMS_CLIENT_DIR%\tokreplw.exe<qt/>
<qt/>%LDMS_CLIENT_DIR%\winbom.ini<qt/> COMPUTERNAME=%Computer -
Device Name%
REMEXEC14=<qt/>%LDMS_CLIENT_DIR%\copyfile.exe<qt/> c:\ldvpe1.img
<qt/>%LDMS_CLIENT_DIR%\ldiscan.cfg<qt/> \ldclient\ldiscan.cfg
REMEXEC15=<qt/>%LDMS_CLIENT_DIR%\copyfile.exe<qt/> c:\ldvpe1.img
<qt/>%LDMS_CLIENT_DIR%\winbom.ini<qt/> \winbom.ini
REMEXEC16=<qt/>%LDMS_CLIENT_DIR%\sdclient.exe<qt/> /f /o
/dest="%LDMS_CLIENT_DIR%\diskinfo.exe"
/p="http://%CUSTJOBHOSTIP%/landesk/files/diskinfo.exe"
REMEXEC17=<qt/>%LDMS_CLIENT_DIR%\diskinfo.exe<qt/>
update_winnt_sif <qt/>%LDMS_CLIENT_DIR%\winnt.sif.new<qt/>
REMEXEC18=<qt/>%LDMS_CLIENT_DIR%\copyfile.exe<qt/>
<qt/>%LDMS_CLIENT_DIR%\ldvpe0.img<qt/>
<qt/>%LDMS_CLIENT_DIR%\winnt.sif.new<qt/> \winnt.sif
REMEXEC19=<qt/>%LDMS_CLIENT_DIR%\lddefrag.exe<qt/>
<qt/>%LDMS_CLIENT_DIR%\ldvpe0.img<qt/>, STATUS
REMEXEC20=<qt/>%LDMS_CLIENT_DIR%\bootfile.exe<qt/>
%LDMS_CLIENT_DIR%\ldvpe0.img /keep /bootunsafe, ASYNC
BEGINWINPE=TRUE
REMPING21=WINPE, TIMEOUT=1800
REMEXEC22=drvmap.exe Domain\admin 1053C9FC81E60EEC3DF260F1E5A I:
<qt/>\\ImageServer\images<qt/>, STATUS FACILITY=3513
REMEXEC23=drvmap.exe Domain\admin 1053C9FC81E60EEC3DF260F1E5A H:
<qt/>\\CoreServer\ldmain<qt/>, STATUS FACILITY=3513
REMEXEC24=diskpart /s X:\LDClient\rmvol.txt
REMEXEC25=diskpart /s X:\LDClient\assvol.txt
REMEXEC26=cmd /c del /f /q C:\ldvpe1.img
REMEXEC27=RunBatch -1 H:\osd\imaging backall.bat 0 i:\%Computer -
Device Name{6}%, STATUS FACILITY=3510, SYNC, TIMEOUT=3600
REMEXEC28=reboot, timeout=2
48
BEGINWINPE=TRUE
This line is used to determine the point in the script where commands that are
to run only in WinPE begin.
REMPING21=WINPE, TIMEOUT=1800
This line performs a CBA ping that queries the workstation for the WinPE
version of the LANDesk Agent. If the LANDesk Agent is not detected within 1800
seconds, this line fails.
REMEXEC22=drvmap.exe Domain\admin 1053C9FC81E60EEC3DF260F1E5A I:
<qt/>\\ImageServer\images<qt/>, STATUS FACILITY=3513
This line is used to map a drive to the share where the image is to be stored.
Drvmap.exe is a simple executable that decrypts the hashed password before
mapping a drive.
REMEXEC23=drvmap.exe Domain\admin 1053C9FC81E60EEC3DF260F1E5A
H: <qt/>\\CoreServer\ldmain<qt/>, STATUS FACILITY=3513
This line is used to map a drive to the share where the image tool ImageW.exe
resides. Drvmap.exe is a simple executable that decrypts the hashed password
before mapping a drive.
REMEXEC24=diskpart /s X:\LDClient\rmvol.txt
This line uses Microsoft’s diskpart.exe to remove any volumes that may
possibly already exist. Volumes may point to hard drives, USB drives, CD or DVD
drives, or others. These are cleared so that they can be reassigned in the
following line.
REMEXEC25=diskpart /s X:\LDClient\assvol.txt
This line uses Microsoft’s diskpart.exe tool to reassign volumes.
REMEXEC26=cmd /c del /f /q C:\ldvpe1.img
This line is not necessary during a PXE boot. It is used to delete the
LDVPE1.img file that from the hard drive after a LANDesk vboot.
REMEXEC27=RunBatch -1 H:\osd\imaging backall.bat 0 i:\%Computer -
Device Name{6}%, STATUS FACILITY=3510, SYNC, TIMEOUT=3600
This line calls RunBatch, a tool that runs batch files, which calls Backall.bat.
Backall.bat calls ImageAlw.exe and ImageW.exe to capture an image of all
the partitions on the first drive.
REMEXEC28=reboot, timeout=2
This line is reboots the device once the image has been captured.
49
ScriptDescription=This script deploys a Sysprepped Windows XP
image
MCast=0
FallBackNIC=
UseFallBackNIC=FALSE
ImageUserName=admin
ImageDomain=Domain.com
ImagePassword=1053C9FC81E60EEC3DF260F1E5A
ImageToolType=5
ImageUNC=\\ImageServer\images\31FC4A00.img
ToolUNC=\\CoreServer\ldmain\osd\imaging\imagew.exe
ImageToolCmd=RunBatch -1 h:\osd\imaging imagew.exe /RN /O
i:\31FC4A00.img, STATUS FACILITY=3510, SYNC
ImageToolCmdsFile=\\CoreServer\LDMAIN\LANDESK\FILES\WinPE Deploy
Sysprepped XP.txt
IsSysPrepImage=1
IsVistaSysPrep=0
UseExistingSysPrep=0
ExistingSysPrepFile=
SysPrepFile=\\CoreServer\LDMAIN\LANDESK\FILES\WinPE Deploy
Sysprepped XP.inf
RemoteSysPrepCopyPath=c:\sysprep\sysprep.inf
SysPrepTargetedType=0
UseInventoryName=1
ComputerNameTemplate=Sales-nnn
ClientInstallDomain=Domain.com
ClientInstallUsername=admin
ClientInstallPassword=1053C9FC81E60EEC3DF260F1E5A
ClientInstallUNC=\\CoreServer\ldlogon
ConfigProcessors=0
ImageHWType=0
ImageOSType=0
ImageProcessorType=0
RemoteProcessorPath=%windir%\inf\hal.inf
ConfigAdvancedMCast=0
UseWOL=FALSE
WOLSeconds=120
DiscoveryType=0
MaxTMCThreads=5
MinTMCSleep=1
MaxTMCSleep=200
SubrepTTL=14
TargetTTL=2
[OWNER]
GUID=eeff8fb7-8ea1-4fe8-9385-9a950f687b69
OSDPLUG=TRUE
DESCRIPTION=This script deploys a Sysprepped Windows XP image
NAME=WinPE Deploy Sysprepped XP
TYPE=WinPE
[JOBPARAM]
ABORT_ON_CMD_FAILURE=1
TASK_COMPLETION_ENABLED=FALSE
50
AUTOCOMPUTERNAME=Sales-nnn
[MACHINES]
REMEXEC0=<qt/>%LDMS_CLIENT_DIR%\sdclient.exe<qt/> /f /o
/p="http://%CUSTJOBHOSTIP%/landesk/vboot/bootfile.exe"
REMEXEC1=<qt/>%LDMS_CLIENT_DIR%\sdclient.exe<qt/> /f /o
/p="http://%CUSTJOBHOSTIP%/landesk/vboot/tlibr16.dll"
REMEXEC2=<qt/>%LDMS_CLIENT_DIR%\sdclient.exe<qt/> /f /o
/p="http://%CUSTJOBHOSTIP%/landesk/vboot/tlibr32.dll"
REMEXEC3=<qt/>%LDMS_CLIENT_DIR%\sdclient.exe<qt/> /f /o
/p="http://%CUSTJOBHOSTIP%/landesk/vboot/lddefrag.exe"
REMEXEC4=<qt/>%LDMS_CLIENT_DIR%\sdclient.exe<qt/> /f /o
/p="http://%CUSTJOBHOSTIP%/landesk/vboot/cicfgmgr.vxd"
REMEXEC5=<qt/>%LDMS_CLIENT_DIR%\sdclient.exe<qt/> /f /o
/p="http://%CUSTJOBHOSTIP%/landesk/vboot/cindis.vxd"
REMEXEC6=<qt/>%LDMS_CLIENT_DIR%\sdclient.exe<qt/> /f /o
/p="http://%CUSTJOBHOSTIP%/landesk/vboot/copyfile.exe"
REMEXEC7=<qt/>%LDMS_CLIENT_DIR%\sdclient.exe<qt/> /f /o
/p="http://%CUSTJOBHOSTIP%/landesk/vboot/winbom.ini"
REMEXEC8=<qt/>%LDMS_CLIENT_DIR%\sdclient.exe<qt/> /f /o
/p="http://%CUSTJOBHOSTIP%/landesk/vboot/ldvpe0.img"
REMEXEC9=<qt/>%LDMS_CLIENT_DIR%\sdclient.exe<qt/> /f /o
/dest="C:\ldvpe1.img"
/p="http://%CUSTJOBHOSTIP%/landesk/vboot/ldvpe1.img"
REMEXEC10=<qt/>%LDMS_CLIENT_DIR%\sdclient.exe<qt/> /f /o
/p="http://%CUSTJOBHOSTIP%/landesk/vboot/tokreplw.exe"
REMEXEC11=<qt/>%LDMS_CLIENT_DIR%\sdclient.exe<qt/> /f /o
/dest="%LDMS_CLIENT_DIR%\ldiscan.cfg"
/p="http://%CUSTJOBHOSTIP%/landesk/vboot/guid.pds"
REMEXEC12=<qt/>%LDMS_CLIENT_DIR%\tokreplw.exe<qt/>
<qt/>%LDMS_CLIENT_DIR%\ldiscan.cfg<qt/> DEVICEID=%Computer -
Device ID%
REMEXEC13=<qt/>%LDMS_CLIENT_DIR%\tokreplw.exe<qt/>
<qt/>%LDMS_CLIENT_DIR%\winbom.ini<qt/> COMPUTERNAME=%Computer -
Device Name%
REMEXEC14=<qt/>%LDMS_CLIENT_DIR%\copyfile.exe<qt/> c:\ldvpe1.img
<qt/>%LDMS_CLIENT_DIR%\ldiscan.cfg<qt/> \ldclient\ldiscan.cfg
REMEXEC15=<qt/>%LDMS_CLIENT_DIR%\copyfile.exe<qt/> c:\ldvpe1.img
<qt/>%LDMS_CLIENT_DIR%\winbom.ini<qt/> \winbom.ini
REMEXEC16=<qt/>%LDMS_CLIENT_DIR%\sdclient.exe<qt/> /f /o
/dest="%LDMS_CLIENT_DIR%\diskinfo.exe"
/p="http://%CUSTJOBHOSTIP%/landesk/files/diskinfo.exe"
REMEXEC17=<qt/>%LDMS_CLIENT_DIR%\diskinfo.exe<qt/>
update_winnt_sif <qt/>%LDMS_CLIENT_DIR%\winnt.sif.new<qt/>
REMEXEC18=<qt/>%LDMS_CLIENT_DIR%\copyfile.exe<qt/>
<qt/>%LDMS_CLIENT_DIR%\ldvpe0.img<qt/>
<qt/>%LDMS_CLIENT_DIR%\winnt.sif.new<qt/> \winnt.sif
REMEXEC19=<qt/>%LDMS_CLIENT_DIR%\lddefrag.exe<qt/>
<qt/>%LDMS_CLIENT_DIR%\ldvpe0.img<qt/>, STATUS
REMEXEC20=<qt/>%LDMS_CLIENT_DIR%\bootfile.exe<qt/>
%LDMS_CLIENT_DIR%\ldvpe0.img /keep /bootunsafe, ASYNC
BEGINWINPE=TRUE
REMPING21=WINPE, TIMEOUT=1800
51
REMEXEC22=drvmap.exe Domain\admin 1053C9FC81E60EEC3DF260F1E5A I:
<qt/>\\ImageServer\images<qt/>, STATUS FACILITY=3513
REMEXEC23=drvmap.exe Domain\admin 1053C9FC81E60EEC3DF260F1E5A H:
<qt/>\\CoreServer\ldmain<qt/>, STATUS FACILITY=3513
REMEXEC24=diskpart /s X:\LDClient\wipeDisk0.txt
REMEXEC25=cmd /c format /Y /FS:NTFS /Q /V:C-DRIVE c:
REMEXEC26=RunBatch -1 h:\osd\imaging imagew.exe /RN /O
i:\31FC4A00.img, STATUS FACILITY=3510, SYNC
REMEXEC27=sdclient /f /o /dest="X:\LDClient\diskinfo.exe"
/p="http://%CUSTJOBHOSTIP%/landesk/files/diskinfo.exe", STATUS
REMEXEC28=sdclient /f /o /dest="X:\LDClient\assvol.txt"
/p="http://%CUSTJOBHOSTIP%/landesk/files/assvol.txt", STATUS
REMEXEC29=tokreplw X:\LDClient\assvol.txt partition=1
REMEXEC30=diskpart /s X:\LDClient\assvol.txt
REMEXEC31=sdclient /f /o /dest="C:\sysprep\sysprep.inf"
/p="http://%CUSTJOBHOSTIP%/landesk/files/WinPE%20Deploy%20Sysprep
ped%20XP.inf", STATUS
REMEXEC32=sdclient /f /o /dest="C:\ldsleep.exe"
/p="http://%CUSTJOBHOSTIP%/landesk/files/ldsleep.exe", STATUS
REMEXEC33=tokreplw C:\sysprep\sysprep.inf COMPUTERNAME=%Computer
- Device Name%
REMEXEC34=cmd /c copy /y X:\LDClient\guid.pds C:\LDISCAN.CFG
REMEXEC35=tokreplw C:\LDISCAN.CFG DEVICEID=%Computer - Device ID%
REMEXEC36=tokreplw C:\LDISCAN.CFG
IMAGEPATH=\\ImageServer\images\31FC4A00.img
REMEXEC37=sdclient.exe<qt/> /f /o
/dest="x:\ldclient\fixvista.bat"
/p="http://%CUSTJOBHOSTIP%/landesk/files/FixVista.bat"
REMEXEC38=sdclient.exe<qt/> /f /o /dest="x:\ldclient\fixntfs.exe"
/p="http://%CUSTJOBHOSTIP%/landesk/files/fixntfs.exe"
REMEXEC39=sdclient.exe<qt/> /f /o /dest="x:\ldclient\bcdedit.exe"
/p="http://%CUSTJOBHOSTIP%/landesk/files/bcdedit.exe"
REMEXEC40=RunBatch -1 X:\LDCLient x:\ldclient\FixVista.bat
REMEXEC41=diskinfo extend_last_partition
REMEXEC42=reboot, timeout=2
52
REMPING21=WINPE, TIMEOUT=1800
This line performs a CBA ping that queries the workstation for the WinPE
version of the LANDesk Agent. If the LANDesk Agent is not detected within 1800
seconds, this line fails.
REMEXEC22=drvmap.exe Domain\admin 1053C9FC81E60EEC3DF260F1E5A I:
<qt/>\\ImageServer\images<qt/>, STATUS FACILITY=3513
This line is used to map a drive to the share where the image is to be stored.
Drvmap.exe is a simple executable that decrypts the hashed password before
mapping a drive.
REMEXEC23=drvmap.exe Domain\admin 1053C9FC81E60EEC3DF260F1E5A
H: <qt/>\\CoreServer\ldmain<qt/>, STATUS FACILITY=3513
This line is used to map a drive to the share where the image tool ImageW.exe
resides. Drvmap.exe is a simple executable that decrypts the hashed password
before mapping a drive.
REMEXEC24=diskpart /s X:\LDClient\wipeDisk0.txt
This line is uses Microsoft’s diskpart.exe tool to wipe all partition from the
drive.
REMEXEC25=cmd /c format /Y /FS:NTFS /Q /V:C-DRIVE c:
This line is uses Microsoft’s format.exe tool to format the drive using NTFS.
This command in not necessary for ImageW.exe and is included for another
imaging utility that may need it.
REMEXEC26=RunBatch -1 h:\osd\imaging imagew.exe /RN /O
i:\31FC4A00.img, STATUS FACILITY=3510, SYNC
This line calls RunBatch, a tool that runs batch files, which calls ImageW.exe
to deploy a single partition image to the first drive. The image is written to the
hard drive here.
Note: If the image being deployed was a multi-partition image, RunBatch
would have called Restall.bat, which uses ImageAlw.exe, instead
of directly calling ImageW.exe.
REMEXEC27=sdclient /f /o /dest="X:\LDClient\diskinfo.exe"
/p="http://%CUSTJOBHOSTIP%/landesk/files/diskinfo.exe", STATUS
This line calls sdclient.exe with these parameters: /f (file transfer), /o
(overwrite), /dest (destination path), and /p (source path). The file is
downloaded from the source to the destination.
This line is used to download diskinfo.exe. Diskinfo.exe is used to expand a
partition to fill the entire drive.
53
REMEXEC28=sdclient /f /o /dest="X:\LDClient\assvol.txt"
/p="http://%CUSTJOBHOSTIP%/landesk/files/assvol.txt", STATUS
This line calls sdclient.exe with these parameters: /f (file transfer), /o
(overwrite), /dest (destination path), and /p (source path). The file is
downloaded from the source to the destination. This line is used to download
assvol.txt. Assvol.txt is a script used with diskpart.exe to assign the correct
volumes.
REMEXEC29=tokreplw X:\LDClient\assvol.txt partition=1
This line uses tokreplw.exe, a tool used to replace tokens in a text file, to
modify the assvol.txt so that the correct partition is set to be the C drive.
In this example, the C drive is partition=1, however if the system had a vendor
partition as the first partition, the C drive should be set to partition=2.
This setting is configured when created the OS Deployment script on the Image
type and path screen.
REMEXEC30=diskpart /s X:\LDClient\assvol.txt
This line calls diskpart.exe with the assvol.txt script. This executes the script
to assign the C drive to the correct partition on the correct volume.
REMEXEC31=sdclient /f /o /dest="C:\sysprep\sysprep.inf"
/p="http://%CUSTJOBHOSTIP%/landesk/files/WinPE%20Deploy%20Sysprep
ped%20XP.inf", STATUS
This line calls sdclient.exe with these parameters: /f (file transfer), /o
(overwrite), /dest (destination path), and /p (source path). The file is
downloaded from the source to the destination. This line is used to download
sysprep.inf file. On the source, the sysprep.inf is named after the script, but
when downloaded, it is placed on the C drive in the Sysprep folder and named
Sysprep.inf.
REMEXEC32=sdclient /f /o /dest="C:\ldsleep.exe"
/p="http://%CUSTJOBHOSTIP%/landesk/files/ldsleep.exe", STATUS
This line calls sdclient.exe with these parameters: /f (file transfer), /o
(overwrite), /dest (destination path), and /p (source path). The file is
downloaded from the source to the destination. This line is used to download
ldsleep.exe file. LDSleep.exe is used as the first command in the GUIRunOnce
section of Sysprep to wait 30 seconds to allow other services to start on the
workstation before starting to run other GUIRunOnce commands.
Without ldsleep.exe, the net use command in the GUIRunOnce section of
Sysprep may fail, causing the LANDesk Agent to not install, which causes the
workstation to remain logged in as a local administrator.
54
REMEXEC33=tokreplw C:\sysprep\sysprep.inf COMPUTERNAME=%Computer -
Device Name%
This line uses tokreplw.exe, a tool used to replace tokens in a text file, to
dynamically modify sysprep.inf so that the correct computer name is used. The
database token %Computer - Device Name% uses the current name if the
workstation exists in the LANDesk inventory database or it uses the alternate
naming scheme configured when creating the OS Deployment script.
REMEXEC34=cmd /c copy /y X:\LDClient\guid.pds C:\LDISCAN.CFG
This line copies a file to the C drive called LDISCAN.CFG. When the agent
installs, it looks for this file, and if it is there, it uses the same Device ID that
is listed in this file. This allows an existing workstation to have the same
Device ID after it is re-imaged.
REMEXEC35=tokreplw C:\LDISCAN.CFG DEVICEID=%Computer - Device ID%
REMEXEC36=tokreplw C:\LDISCAN.CFG
IMAGEPATH=\\ImageServer\images\31FC4A00.img
The above two lines uses tokreplw.exe, a tool used to replace tokens in a text
file, to dynamically modify LDISCAN.CFG to contain the correct Device ID and
the IMAGEPATH. These values will be visible in the LANDesk inventory database
after the device installs the LANDesk Agent and send in a scan.
REMEXEC37=sdclient.exe<qt/> /f /o /dest="x:\ldclient\fixvista.bat"
/p="http://%CUSTJOBHOSTIP%/landesk/files/FixVista.bat"
REMEXEC38=sdclient.exe<qt/> /f /o /dest="x:\ldclient\fixntfs.exe"
/p="http://%CUSTJOBHOSTIP%/landesk/files/fixntfs.exe"
REMEXEC39=sdclient.exe<qt/> /f /o /dest="x:\ldclient\bcdedit.exe"
/p="http://%CUSTJOBHOSTIP%/landesk/files/bcdedit.exe"
The above three lines call sdclient.exe with these parameters: /f (file
transfer), /o (overwrite), /dest (destination path), and /p (source path). The
file is downloaded from the source to the destination.
These lines are used to download tools needed to make images for Windows
Vista work and are not necessary unless imaging Vista.
REMEXEC40=RunBatch -1 X:\LDCLient x:\ldclient\FixVista.bat
This line calls RunBatch to launch a FixVista.bat which in turn calls the tools
needed to make images for Windows Vista work. This line is not necessary
unless imaging Windows Vista.
REMEXEC41=diskinfo extend_last_partition
This line calls diskinfo.exe to extend the last partition to fill the entire drive.
55
REMEXEC42=reboot, timeout=2
This line calls reboots the workstation as the imaging process is now complete
and the device is ready to reboot and run through mini-setup, which is
automated because of the presence of the sysprep.inf in c:\sysprep.
Without this line, the script may be overwritten when the task is scheduled.
The information for the script is stored in the database and the script may be
recreated from this information when the task is scheduled. However, if this
line exists, the script will not be overwritten.
56
Adding Commands to the End of an OS Deployment Script
Commands can be added manually to the end of an OS Deployment script.
While lines can be added to any place inside the script for numerous reasons,
this section will only describe how to add lines to the end of the script.
Comments can be added. A commented line is any line that begins with a semi-
colon (;). It is recommended that when adding lines, comments be added to
explain why the line was added.
;This is a comment.
The last line reboots the workstation. If adding commands afterwards, the
following line must check for the LANDesk Agent. Remember, the LANDesk
Agent is installed by the GUIRunOnce section of the Sysprep.inf. This means
the device must reboot, run through Sysprep, run the GUIRunOnce commands,
and reboot again before the LANDesk Agent can be detected. The timeout
needs to be set long enough to allow all this to occur.
This is an example of how to have a Scheduled Task execute to deploy software
via a policy on the workstation after it is fully booted up and ready. The
example contains many comments. Lines that are not comments are in bold.
Note: The scheduled task must be targeted to a query and the
workstation must be included in that query once it send inventory
to the LANDesk database. The Task ID must be obtained. This Task
ID is in the name of the Software Distribution task’s log file.
REMEXEC27=reboot
; This next line waits for the reboots and the LANDesk Agent
REMPING28=WIN TIMEOUT=900
; Once the Agent is detected, allow 5 more minutes just to make
; sure all services are started with a SLEEP line and that the
; inventory scan has been processes by the Core Server, more time
; can be added if needed.
SLEEP29=300
; Runing a LOCEXEC runs the command on the Core server. This
; runs a command on the core to update a query for the task so
; the query includes the newly imaged device. The scan must have
; processed by now.
; Warning: This causes processing on the Core Server for each
; device that runs this script. Do not run on too many devices at
; one time.
LOCEXEC30="C:\Program Files\LANDesk\ManagementSuite\schedqry.exe"
/allqueries
; Instead of the /allqueries switch, a /policy=<TaskID>) switch
; can be used. This only resolves the queries for one task which
; uses less overhead.
; Sleep again to make sure the query has time to evaluate and
; update the task.
SLEEP31=60
; Launch Policy-based delivery (amclient.exe). This line may not
; be needed if amclient.exe is configured to run with Local
57
; Scheduler.
REMEXEC32=<qt/>%LDMS_CLIENT_DIR%\amclient.exe<qt/> /apm /s /ro ,
ASYNC
; ASYNC runs that task without waiting for a status. Status can
; now be obtained by watching the Scheduled Task for software. If
; other policy tasks happened to evaluate their queries as well,
; as this device resolved as a target of the query, then other
; policies may be applied by this process.
;
; End of Custom Edits to the script
58
Capture/Deploy to/from UNC Share A
Capture/Deploy to/from CD U
Command line parameters for ImageW.exe A
Command line parameters for ImageX.exe A
Command line parameters for Ghost32.exe A
Command line parameters for other Imaging tools M
59
60