Creating WinPE 2.0 and later image files using the BMC Server Automation script

You can run the CreateWinPE2_x.vbs script to create a WinPE 2.0 and later x86 or x64 image file.

Before you begin

  • Prepare the machine on which boot images are created.
  • If you plan to create image files for booting from media local to the target server, create a network.ini file.

To create the image file with the script:

  1. Create the input file containing image creation parameters.

    You create the input parameters file to provide the CreateWinPE2_x.vbs script with parameters for the boot image: architecture, location of image creation tools, location of the files to be included in the image, and image type.

    To create the input parameters file:

    1. In a text editor, create a new file with the name filename.ini.
    2. Use the following syntax to specify parameters in the input file.

      Parameter

      Description

      Arch

      (Required) Specifies the architecture of the server for which you are creating the boot image (x86 or x64).

      BLDir

      (Required) Specifies the full path to the \provisioning\winpe subdirectory.
      For example: C:\BMC_BL\provisioning\winpe

      DestDir

      (Required) Specifies the path to the temporary local directory to hold the image files you are about to create. For example: C:\BMC_BL\tmp
      This directory must already exist before you run the CreateWinPE2_x.vbs script.

      BootDir

      (Required) Specifies the boot image name, for example: boot_2_0_x86 or boot_2_0_x64. This name is also the name of the directory containing the image files.
      Note that names containing spaces are not supported.
      In general, you can set BootDir to:
      boot_2_0
      so that you can use the default placeholders in provisioning.
      When you run CreateWinPE2_x.vbs, it creates a directory in the path specified by DestDir. This new directory has the name specified by BootDir and contains the image files.

      CustomScript

      (Optional) Specifies the path to an optional external script that you want to run when the image is mounted. Specify the script's full path and name.

      OverwriteFlag

      (Optional) If DestDir already exists and you want to overwrite it, specify OverwriteFlag=Y

      RSCDDir

      (Local boot image only) Specifies the path to the directory that contains the RSCD agent installer. For example: C:\Installers\RSCD
      The directory should contain the rscd.msi file.

      OSDrvDir

      (Local boot image only) Specifies the path to the directory that contains the driver files required for the operating system installation. For example: C:\Installers\Drivers

      BMIWinExe

      (Local boot image only) Specifies the path to the bmiwin.exe file you want to copy the local media. Specify a path name that includes the file name. For example: D:\DataStore\bmiwin.exe

      CopyToISO

      (Local boot image only) Specifies whether the script copies the configuration components (RSCD agent installer files, operating system driver files, and bmiwin.exe) to the WinPE ISO or to the LDS directory inside the WinPE image.
      Specify CopyToISO=Y to copy these files to the root of the WinPE ISO. This is the default.
      Specify CopyToISO=N to copy these files to the LDS directory.

      NetDetailsFile

      (Local boot image only) Specifies the path to the network.ini file.
      This file provides network details for each target server (static IP address, subnet mask, default gateway, WINS server) in provisioning environments where there is no DHCP server or where you want to map MAC addresses to static IPs.
      Specify a path name that includes the file name. For example: D:\Scripts\network.ini
      This file must already exist.

      AppServer

      (Local boot image only) Specifies the IP address of the Application Server that the target server contacts. Specify this parameter when a DHCP server is not present in the provisioning environment or if the DHCP server is not configured to provide the address.
      If you specify this parameter, the script includes the IP address in the WinPE image.

      AppServerPort

      (Local boot image only) Specifies the port number for the target server to use in contacting the Application Server. Specify this parameter when a DHCP server is not present in the provisioning environment or if the DHCP server is not configured to provide the address.
      If you specify this parameter, the script includes the port number in the WinPE image.

      CreatePXEFlag

      Specifies whether to generate PXE boot files for the image.
      Specify CreatePXEFlag=Y to generate the files. (This is the default.) The script creates the image files and puts them in a PXE bootable directory with the name you specified for BootDir. For example: boot_2_0_x86
      Specify CreatePXEFlag=N to suppress generation of the files.

      CreateISOFlag

      (Local boot image only) Specifies whether to generate ISO boot files for the image.
      Specify CreateISOFlag=Y to generate the files. The script creates the ISO file with the name you specified for BootDir, plus the .iso extension. For example: boot_2_0_x86.iso
      Specify CreateISOFlag=N to suppress generation of the files. (This is the default.)

      CreateUFDFilesFlag

      (Local boot image only) Specifies whether to create UFD image files for booting from a USB flash drive.
      Specify CreateUFDFilesFlag=Y to generate the files. The script creates a directory with the name BootDir_UFD and puts in it the files for booting from a USB flash drive. For example: boot_2_0_x86_UFD
      Specify CreateUFDFilesFlag=N to suppress generation of UFD files. (This is the default.)

      WAIKRootDir

      Specifies a path to the Microsoft Windows Automated Installation Kit (WAIK).
      Specify a value if you want to overwrite the default path. The default path is: C:\Program Files\Windows AIK

      Debug

      Specifies whether the script displays output messages as it runs.
      Specify Debug=Y to display this information.
      Specify Debug=N to suppress the display of this information. (This is the default.)

    Example

    This example creates a WinPE x86 boot image for booting from the PXE server only.

    Arch=x86
    BLDir=D:\BladeExtract\winpe
    DestDir=D:\WinPEImg\x86
    BootDir=boot_2_0_x86
    CustomScript=D:\Scripts\addADP.bat
    CreatePXEFlag=Y
    OverwriteFlag=Y
    WAIKRootDir=C:\Program Files\WinAIK
    Debug=N

    This example creates two WinPE x86 boot images for booting from local media:

    • boot_2_0_x86.iso — An ISO image for booting from CD/DVD
    • boot_2_0_x86_UFD — A UFD image for booting from USB flash drive
    Arch=x86
    BLDir=D:\BladeExtract\winpe
    DestDir=D:\WinPEImg\x86
    BootDir=boot_2_0_x86
    RSCDDir=D:\DataStore\RSCD\rscd_76_x86
    OSDrvDir=D:\DataStore\Drivers
    BMIWinExe=D:\DataStore\bmiwin.exe
    CopyToISO=Y
    CustomScript=D:\Scripts\addADP.bat
    NetDetailsFile=D:\Scripts\network.ini
    AppServer=190.165.33.1
    AppServerPort=9831
    CreatePXEFlag=N
    CreateISOFlag=Y
    CreateUFDFilesFlag=Y
    OverwriteFlag=Y
    WAIKRootDir=C:\Program Files\WinAIK
    Debug=Y

  2. Run the CreateWinPE_2_0.vbs script to create the image files.

    Run the CreateWinPE2_x.vbs script to create a WinPE 2.0 and later x86 or x64 image file.

    Before you begin

    • On the machine where you are creating the image files, create a temporary local directory to hold the image files. For example: C:\BMC_BL\tmp.
    • Create the input parameters file used by the script. See Creating the input parameters .ini file.

    To run the script

    1. At the command prompt, enter the cscript command with the following arguments:
      cscript //nologo "createWinPEScriptPath>" <inputFilePath>
      Where:
      cscript — Calls the Visual Basic (.vbs) script without displaying a message box type of user interface.
      //nologo — (Optional) Hides the MicroSoft copyright information.
      <createWinPEScriptPath> — Specifies the path to the CreateWinPE2_x.vbs script. Enclose this path in double quotation marks (").
      <inputFilePath> — Specifies the path to the input file containing the image creation parameters.
      For example:

      cscript //nologo "C:\Program Files\WinAIK\Tools CreateWinPE2_x.vbs" C:\winpe_x86.ini

       

       

      Unknown macro: {multi-excerpt}

     

  3. Copy the image files to the TFTP server for booting from the PXE server (PXE image type) or to the media you want to use for booting the target server locally (ISO or UFD image types).

    You copy the WinPE 2.0 and later image files to a location so the provisioning process can use them. The location to which you copy files depends on the image type of the WinPE image you created (PXE, ISO, or UFD).

    To copy image files of the PXE image type

    1. Copy the image file to the TFTP server. Perform this step only if you created the image with the CreateWinPE2_x.vbs script. (If you created the image with the image creation wizard, the image creation process copies the image to the TFTP server.)

      You copy the WinPE 2.0 and later boot image to the TFTP server so that the provisioning process can use it with the PXE provisioning technology.

      The "image file" is actually a directory containing several separate files. When you run CreateWinPE2_x.vbs, it creates this directory in the path specified by DestDir. This new directory has the name specified by BootDir and contains the image files.

      For example if you specified a BootDir name of_ boot_2_0 (the recommended name for the directory), the script creates the boot_2_0 image in DestDir:

      C:\BMC_BL\tmp\boot_2_0
      BCD
      boot.sdi
      WinPE.wim
      

      To copy boot image files to the TFTP server

      To place the image files on the TFTP server, copy BootDir and its contents to the tftproot directory on the TFTP server. For example:

      C:\tftproot\boot_2_0
      BCD
      boot.sdi
      WinPE.wim
      

      Note

      The BLAdmin role must be granted Read and Write access to the TFTP root directory and its contents, including boot image folders and all image files in the folders.

    2. Extract the boot files and copy them to the TFTP server.

      After creating the images with CreateWinPE2_x.vbs, you extract the pxeboot.0 and bootmgr.exe files and copy them to the TFTP server.

      To extract boot files

      1. Create a temporary local directory to store the files you are about to extract.
        For example: C:\BMC_BL\tmpboot
      2. Open a command window and change directories to the \Tools\PETools subdirectory of the Microsoft Windows Automated Installation Kit (WAIK) installation directory.
        For example: C:\Program Files\WinAIK\Tools\PETools
      3. Navigate to the provisioning files that you extracted from provision-files.zip into a temporary directory. In the \provisioning\winpe\ directory, locate the extractpxeboot.vbs script, and copy this file into the \Tools\PETools subdirectory.
      4. Start the WinPE command prompt by typing:
        pesetenv.cmd
      5. Run the extractpxeboot.vbs script to extract pxeboot.0 and bootmgr.exe. Use the following syntax:
        extractpxeboot <DestDir> <WAIK_dir>
        where <DestDir> is the temporary local storage directory that you created at the beginning of this procedure and <WAIK_dir> is the WAIK installation directory.

        Example

        extractpxeboot C:\BMC_BL\tmpboot C:\Program Files\WinAIK


      6. Look at the contents of C:\BMC_BL\tmpboot. You should see pxeboot.0 and bootmgr.exe.
        Copy these files to the following locations on the TFTP server:
        • Copy pxeboot.0 into <tftproot>\x86pc\pxelinux.
          For example: C:\tftproot\x86\pxelinux\pxeboot.0
        • Copy bootmgr.exe into <tftproot>.
          For example: C:\tftproot\bootmgr.exe

    3. If the server that contains your data store does not support the NTLMv2 Level 3 setting for Microsoft NT Lan Manager, change the NTLM settings for the WinPE image on the TFTP server.

      If the server that contains your data store does not support the Microsoft NT Lan Manager (NTLM) settings for NTLMv2 Level 3, you must change the NTLM settings for the WinPE image on the TFTP server.

      Before you begin

      The TFTP server must have the Microsoft Windows Automated Installation Kit (WAIK) installed.

      To change the NTLM settings

      The ImageX command-line tool is deprecated in Windows 8. Use the DISM command-line tool.

       For more information, see the following articles:

       

      1. Use the imagex utility to mount the WinPE image to any empty directory. (The imagex utility comes with WAIK.)

        Example

        1. Create an empty directory, for example C:\new. Copy the WinPE image file WinPE.wim to this new directory.
        2. Create a mount directory under C:\new.
          For example: C:\new\mount
        3. Open a command window and change directories to the \Tools\PETools subdirectory of the Windows AIK installation directory.
          For example: C:\Program Files\WinAIK\Tools\PETools
        4. Start the WinPE command prompt by typing pesetenv.cmd.
        5. On the WinPE command line enter:
          imagex /mountrw C:\new\WinPE.wim 1 C:\new\mount
      2. Open the registry editor (regedit).
      3. Click HKEY_LOCAL_MACHINE.
      4. Choose File > Load Hive.
      5. Select the file:
        %Mounted WinPE Image folder in step1%\Windows\System32\config\SYSTEM
      6. Enter the following key name:
        WinPE_Image_SYSTEM
      7. Browse to: HKEY_LOCAL_MACHINE\WinPE_Image_SYSTEM\ControlSet001\Control\Lsa
      8. This step describes how to add an entry if the LMCompatibilityLevel value does not currently exist. If an LMCompatibilityLevel value already exists, you can edit the existing entry to match these values.
        Select Edit > New> DWORD Value, and then add the following registry values:
        Value Name: LMCompatibilityLevel
        Data Type: REG_DWORD
        Value: 3
        Valid Range: 0,3
      9. Click HKEY_LOCAL_MACHINE\WinPE_Image_SYSTEM.
      10. Choose File > Unload Hive.
      11. Use imagex to unmount the mounted WinPE image:
        imagex /unmount /commit MountFolder

    To copy image files of the ISO image type

    Copy the bootImageName.iso file to the CD or DVD. You can also copy the image to a location for use directly through iLO, virtual CD-ROM, or network mapped driver.

    To copy image files of the UFD image type

    1. Format a USB drive for the FAT32 file system.
    2. Copy the all of the files and folders in the bootImageName_UFD directory to the root of the USB drive.

Was this page helpful? Yes No Submitting... Thank you

Comments