Skip to main content

Building Your Imaging Environment (PSImage)

PSImage is not supported by FileWave Support so please do not submit tickets with them about it. The information provided here is for educational purposes only. If you would like to purchase professional services hours for consulting assistance setting up PSImage or customizing it please contact professional.services@filewave.com with your request. If you have existing unused professional services hours you may be able to use them for this purpose. Any feedback on PSImage can also be sent to the same email address. Any work on this would be done on Discord or in working with Professional Services.

Build Your WinPE boot.wim

  1. Download the latest ADK for Windows 11. Scroll down to the "Other ADK downloads" section and download the "Windows PE add-on for the ADK for Windows 11".
  2. Install the ADK, keep the default installation path, and check the "Deployment Tools" and "User State Migration Tool (USMT)" components.
  3. Install the Windows PE add-on.
  4. Find the Windows Kits program folder in the Windows Start menu and launch the "Deployment and Imaging Tools Environment" as an administrator.
  5. Enter the following commands below in the Deployment and Imaging Tools shell.
    copype amd64 C:\WinPE_amd64
    Dism /Mount-Image /ImageFile:"C:\WinPE_amd64\media\sources\boot.wim" /Index:1 /MountDir:"C:\WinPE_amd64\mount"
    Dism /Add-Package /Image:"C:\WinPE_amd64\mount" /PackagePath:"C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Windows Preinstallation Environment\amd64\WinPE_OCs\WinPE-WMI.cab"
    Dism /Add-Package /Image:"C:\WinPE_amd64\mount" /PackagePath:"C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Windows Preinstallation Environment\amd64\WinPE_OCs\en-us\WinPE-WMI_en-us.cab"
    Dism /Add-Package /Image:"C:\WinPE_amd64\mount" /PackagePath:"C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Windows Preinstallation Environment\amd64\WinPE_OCs\WinPE-NetFX.cab"
    Dism /Add-Package /Image:"C:\WinPE_amd64\mount" /PackagePath:"C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Windows Preinstallation Environment\amd64\WinPE_OCs\en-us\WinPE-NetFX_en-us.cab"
    Dism /Add-Package /Image:"C:\WinPE_amd64\mount" /Packagepath:"C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Windows Preinstallation Environment\amd64\WinPE_OCs\winpe-scripting.cab" 
    Dism /Add-Package /Image:"C:\WinPE_amd64\mount" /Packagepath:"C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Windows Preinstallation Environment\amd64\WinPE_OCs\en-us\winpe-scripting_en-us.cab"
    Dism /Add-Package /Image:"C:\WinPE_amd64\mount" /Packagepath:"C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Windows Preinstallation Environment\amd64\WinPE_OCs\WinPE-PowerShell.cab"
    Dism /Add-Package /Image:"C:\WinPE_amd64\mount" /Packagepath:"C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Windows Preinstallation Environment\amd64\WinPE_OCs\en-us\WinPE-PowerShell_en-us.cab"
    Dism /Add-Package /Image:"C:\WinPE_amd64\mount" /Packagepath:"C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Windows Preinstallation Environment\amd64\WinPE_OCs\winpe-wds-tools.cab" 
    Dism /Add-Package /Image:"C:\WinPE_amd64\mount" /Packagepath:"C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Windows Preinstallation Environment\amd64\WinPE_OCs\en-us\winpe-wds-tools_en-us.cab" 
    Dism /Add-Package /Image:"C:\WinPE_amd64\mount" /Packagepath:"C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Windows Preinstallation Environment\amd64\WinPE_OCs\winpe-wmi.cab"
    Dism /Add-Package /Image:"C:\WinPE_amd64\mount" /Packagepath:"C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Windows Preinstallation Environment\amd64\WinPE_OCs\en-us\winpe-wmi_en-us.cab"
    
  6. Edit C:\WinPE_amd64\mount\Windows\System32\startnet.cmd and replace the contents with the block below. You may have to copy the file to your desktop first, edit the copy, and then copy it back into the System32 folder to overwrite the original.
    @echo off
    wpeinit
    cd \imaging
    \windows\system32\windowspowershell\v1.0\powershell.exe -ExecutionPolicy Bypass -File go.ps1
    
  7. Create a folder C:\WinPE_amd64\mount\imaging.
  8. Add this go.ps1 file to the C:\WinPE_amd64\mount\imaging folder.
  9. Create a C:\WinPE_amd64\mount\imaging\config.ini file with the following contents. Make sure you set File Explorer to display file extensions. The icon for the file should look like a blank sheet of paper with a gear in the lower left corner.
    [admin]
    mode=standard
    [autologin]
    autousername=fwadmin
    autopassword=filewave
    [share]
    server=prompt
    share=prompt
    domain=filewavecorp
    username=fwadmin
    password=filewave
    [path]
    image_path=z:\images
    driver_path=z:\models
    msi_path=z:\fwclient
    script_path=z:\scripts
    config_path=z:\config
    history_path=z:\logs
    log_path=z:\logs
    util_path=z:\utils
    extra_path=z:\extra
    
  10. If you want to gate WinPE so that a password is required to access the imaging environment, add a file at C:\WinPE_amd64\mount\imaging\password.txt and add your password in it. Make sure there is no white space before nor after the password.
  11. Close all text editors and File Explorer windows to ensure that there are no open files on the mount point for boot.wim.
  12. Commit your changes and unmount the WIM image with
    dism /unmount-image /mountdir:C:\WinPE_amd64\mount /commit
    
  13. Your WinPE boot.wim file is available at "C:\WinPE_amd64\media\sources\boot.wim".

Editing Pre-imaging Components in WinPE

WinPE is contained in the boot.wim file and holds the config.ini that has your pre-imaging and imaging configuration data. This info tells the disk imaging where to find various resources. It must be customized for your environment. To mount and edit the boot.wim file

  1. Open a CMD prompt with admin privileges and run
    dism /mount-image /ImageFile:"C:\WinPE_amd64\media\sources\boot.wim" /Index:1 /MountDir:"C:\WinPE_amd64\mount"
    
  2. Browse to C:\WinPE_amd64\mount\imaging and edit config.ini or add/remove password.txt. The password inside password.txt, if this file is present, is used to restrict unauthorized access.
  3. Close all Windows Explorer windows. Make sure neither config.ini nor password.txt are open in an editor. Otherwise the unmount will fail.
  4. Commit changes to WIM and unmount with
    dism /unmount-image /mountdir:C:\WinPE_amd64\mount /commit
    

Below is a sample config.ini with explanations. Notes are surrounded by parentheses and are not present in the actual config.ini.

[admin]
mode=standard (set to "usb" => for local imaging on dual partitioned USB thumb stick)

[autologin] (do not change, credentials for temp admin account used to autologin for post-imaging, account deleted when imaging complete)
autousername=fwadmin 
autopassword=filewave

[share] (credentials for accessing the psimage share for reimaging)
server=myserver (if set to "prompt" => go.ps1 will prompt for server address hosting psimage share in multi-location/server env)
share=psimage (if set to "prompt" => go.ps1 will prompt user for the domain, username, and password in a multi-location/server env)
domain=filewavecorp (change as needed)
username=fwadmin (change as needed)
password=filewave (change as needed)

[path] (do not change these unless instructed to do so)
image_path=z:\images
driver_path=z:\models
msi_path=z:\fwclient
script_path=z:\scripts
config_path=z:\config
history_path=z:\logs
log_path=z:\logs
extra_path=z:\extra

Creating a bootable ISO

Follow the instructions in the section above titled "Editing Pre-imaging Components in WinPE" to ensure that your config.ini is set up correctly with "mode=standard". Go to Windows Kits, start the "Deployment and Imaging Tools Environment" as an administrator, and run the following command.

MakeWinPEMedia /ISO C:\WinPE_amd64 C:\WinPE_amd64\WinPE_amd64.iso

Setting up your bootable USB thumb stick

Follow the instructions in the section above titled "Editing Pre-imaging Components in WinPE" to ensure that your config.ini is set up correctly with "mode=standard" and a password.txt if desired.

  1. Insert a USB thumb stick.
  2. Open a CMD session with admin privileges.
  3. Launch diskpart and enter the following series of commands. Run "list disk" at the diskpart prompt to determine the number assigned to your thumb drive, usually 1 unless your PC has more than one disk drive. 0 is normally the designation for your boot drive, which is typically the hard disk you're booted into.
    select disk 1
    clean
    create partition primary size=750
    active
    format fs=FAT32 quick label="WinPE"
    assign letter=P
    exit
    
  4. To create a bootable USB thumb drive run
    xcopy C:\WinPE_amd64\media P:\ /s
    

Setting up a dual-partitioned USB thumb stick for local imaging

Follow the instructions in the section above titled "Editing Pre-imaging Components in WinPE" to ensure that your config.ini is set up correctly with "mode=usb" and a password.txt if desired.

  1. Insert a USB thumb stick.
  2. Open a CMD session with admin privileges.
  3. Launch diskpart and enter the following series of commands. Run "list disk" at the diskpart prompt to determine the number assigned to your thumb drive, usually 1 unless your PC has more than one disk drive. 0 is normally the designation for your boot drive, which is typically the hard disk you're booted into.
    select disk 1
    clean
    create partition primary size=750
    active
    format fs=FAT32 quick label="WinPE"
    assign letter=P
    create partition primary
    format fs=NTFS quick label="Imaging"
    assign letter=I  
    exit
    
  4. Copy the WinPE files to the bootable FAT32 partition of the USB thumb stick with
    xcopy C:\WinPE_amd64\media P:\ /s
    
  5. Copy the contents of the PSImage_v0.3.zip file to the root level of the I: drive.

Cloning your USB thumb stick

Once you have your USB thumb sticks configured the way you like them use ImageUSB to take an image of it. This image can then be written to any other thumb drive, as long as the target thumb drive is the same size or larger than the original. For local disk imaging the secondary NTFS volume on the thumb drive will be expanded to consume all available space when you check “Extend/Add Partition (NTFS only)”.

Adding your boot.wim to WDS for PXE booting

This method can be used for both capturing the master image and restoring it to target PCs.

  1. Follow the instructions in the section above titled "Editing Pre-imaging Components in WinPE" to ensure that your config.ini is set up correctly with "mode=standard" and a password.txt if desired.
  2. Copy the boot.wim file to your WDS server.
  3. Add the WDS feature to your Windows Server. These instructions are for Windows 2019 but will be very similar for other versions of Windows Server.
  4. Go to Windows Administrative Tools > Windows Deployment Services.
  5. Navigate to Servers > LocalServerName, right-click and pick Configure Server.
  6. For testing, pick Standalone server but yours may already be Integrated with Active Directory.
  7. Leave C:\RemoteInstall for the remote installation folder.
  8. Choose Respond to all client computers (known and unknown) unless you already know what you are doing and want to restrict PXE booting.
  9. Uncheck Add images to the server now check and click Finish button.
  10. Navigate to Servers > LocalServerName > Boot Images on the left, right-click on the right and pick Add Boot Image.
  11. Specify your customized boot.wim file as the boot image. Note that PXE booting is significantly slower with BIOS systems than UEFI ones.