Deployment and Workflow (PSImage)
- Deployment and Workflow Overview (PSImage)
- Capturing a Master Image (PSImage)
- Configuration (PSImage)
- Custom Post-Imaging Actions (PSImage)
- Restoring a Disk Image (PSImage)
- Tracking Imaging and Adding Drivers (PSImage)
Deployment and Workflow Overview (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. For the official Windows Imaging solution please see Network Imaging / IVS.
As mentioned before there are 2 components to the disk imaging - 1) an SMB share and 2) a bootable WinPE WIM image - boot.wim. To set up the disk imaging you'll need to
-
Set up the psimage share for access over the network and grant adequate share access.
-
Make the boot.wim available to your client device to be reimaged. There are 4 different ways to do this. Any or all of these methods can be used at the same time to reimage client PCs.
-
Deploy boot.wim with a fileset and have it load via RAM disk (requires device have functional FileWave client installed).
-
Create a bootable USB thumb drive. There are 2 versions of the thumb drive. See Building Your Imaging Environment for instructions.
- A single partition thumb drive to host boot.wim for network imaging. Disk images and driver packs are pulled from the psimage share.
- A dual partition thumb drive for local imaging. The first partition hosts boot.wim. Disk images and driver packs are pulled from a secondary partition on the same thumb drive. In this case there is no interaction with the psimage share. However, network access must still be available during post-imaging so the FileWave client can send in an initial inventory to the FileWave server to trigger the creation of client device entry.
-
Make boot.wim available to PXE clients over the network with a PXE server such as WDS.
-
Create a bootable ISO that hosts boot.wim. See Building Your Imaging Environment for instructions. This can be used to boot a VM for image capture. It can also be burned to optical media for older devices that have an optical drive for image restoration.
-
Prepare your reference computer, VM or physical, for image capture using the provided prep_ref_vm.ps1 script. This will syprep it.
-
Boot your reference VM from the ISO, or a physical PC from a thumb stick or the network to capture a master image.
-
Upload driver packs from each PC model you need to reimage using the upload_driver_pack.ps1 script.
-
Add the customized FileWave client and any optional kiosk customizations.
-
Add a Wi-Fi profile for laptops without a built-in ethernet NIC.
-
Optionally pre-assign disk images, computernames, and custom field values to client PCs via image_mappings.txt. If there is no association, tech will be prompted for disk image and computername.
-
Boot PC from USB thumb stick, network, or via fileset to reimage it.
Setting up the psimage share
- Extract the contents of the PSImage_v0.3.zip file to a folder.
- Share that folder with share name of psimage.
- Grant Everyone Full Control share permissions.
- Create a domain account account, e.g. fwadmin, and grant it Modify NTFS security permissions to this folder.
- From another PC, verify that you can connect to the the psimage share using the above domain account.
Capturing a Master Image (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. For the official Windows Imaging solution please see Network Imaging / IVS.
Prepping your reference PC (VM or physical) for image capture
- Set up a VM or physical PC and install Windows 10 x64 or Windows 11 x64. Please note that older versions and 32-bit versions of Windows have not been tested and will likely not work with this solution. The first account you create during Windows setup will be your default local administrator account that will remain on your PCs after reimaging.
- Place your unattend.xml sysprep answer file in the sysprep folder on the psimage share or the Imaging volume of your USB thumb stick (if imaging locally). You can use this generic answer file if you do not already have one. Edit the file in a text editor to adjust the time zone. Do not include domain join information in your sysprep answer file. That should be handled as a fileset. The device rename happens post-imaging with the local fwadmin account which is not able to modify Active Directory.
- Install all missing Windows updates to clear out the reserved storage. Sysprep will fail on Windows 11 if there are any pending OS updates stored in the reserved storage. If your reference system is a VM, it's probably a good idea to take a VM snapshot now after all OS updates have been installed but before the system has been sysprepped.
- Open a PowerShell session with admin privileges, connect to the psimage share, and navigate to the sysprep folder. If imaging locally change directory to the sysprep folder on the Imaging volume of the USB thumb stick.
- Run the prep_ref_vm.ps1 script. It will create a fwadmin account with a password of "filewave". You may have to set the execution policy to bypass so you can run PowerShell scripts.
- Log out of the reference system and log back in as fwadmin. This lets you skip the new user login assistant during post-imaging on reimaged clients.
- Log out and log back in under the default local admin account. In a PowerShell session with admin privileges connect to the psimage share and run prep_ref_vm.ps1 again to sysprep. If imaging locally change directory to the sysprep folder on the Imaging volume of the USB thumb stick instead.
- If sysprep fails, run remove_app.ps1 from the the sysprep folder to view the setuperr.log and review error messages.
- If the failure was due to reserved storage being in use, check Windows Update and install all remaining updates.
- If the failure was due to an application being installed for a user but not provisioned for all users, remove it using the Remove app option in remove_app.ps1. Repeat this step until sysprep runs successfully.
- The system will shut down upon successful sysprep.
- If this is a VM, it's probably a good idea to take a snapshot of the VM in its shut down sysprepped state in case the reference VM ends up booting into the OS for some reason, as the OOBE can take a while to complete before you can re-sysprep again.
Capturing a master image from a reference VM
- Attach the WinPE_amd64.iso file you built previously to your Windows VM and boot from it.
- You may be prompted to enter the name of the server, share name, and credentials, depending on how config.ini is set up.
- At the main PSImage menu select the option to capture a disk image.
To edit your existing ISO
If you need to make changes to your imaging environment in the boot.wim within the ISO for any reason, follow the steps below.
- Download and install AnyBurn.
- Pick Browse/Extract image file.
- Select the WinPE_amd64.iso file and click the Open button.
- Browse to CD_ROM\Sources, select boot.wim, and click Next button.
- Select desktop folder, check Extract only selected files and folders, and click Next button.
- Mount the boot.wim file, and modify the config.ini with the instructions at Building Your Imaging Environment. You will have to change the "/ImageFile:" argument to point to the path of your boot.wim file extracted from the ISO.
- Open WinPE_amd64.iso in AnyBurn, delete the existing boot.wim file, and the use the Add button to replace it with the updated boot.wim file you just edited.
- Output the changes to the existing ISO and overwrite it.
Capturing a master image from a physical reference PC
- PXE boot the PC or boot it from a USB thumb stick.
- You may be prompted to enter the name of the server hosting the psimage share, depending on how config.ini is set up.
- At the main PSImage menu select the option to capture a disk image.
Configuration (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. For the official Windows Imaging solution please see Network Imaging / IVS.
Adding the FileWave Client
- Using File Explorer, navigate to the fwclient folder on the psimage share or the Imaging volume on your thumb stick.
- Right-click upload_client.ps1 and choose "Run with PowerShell".
- upload_client.ps1 will write a fw_client_version.txt file to the sysprep folder so you know the version of your customized FileWave client that is being installed on client devices during post-imaging. This allows you to update the FileWave client without having to recapture your master image.
- If you have files for kiosk customization create a subfolder named "custom" within the fwclient folder and add those files there. They will be deployed automatically immediately after the FileWave client is installed during post-imaging.
Adding drivers for computer models
- On the computer model you wish to capture drivers for, open a PowerShell session with admin privileges, connect to the psimages share, and navigate to the models folder. If imaging locally change directory to the models folder on the Imaging volume of the USB thumb stick.
- Run the upload_driver_pack.ps1 script to extract 3rd party non-Microsoft drivers. A folder named after the computer model will be created in models folder on the psimage share containing the extracted drivers.
Custom field setup
Set the FileWave server address and app token with the instructions below. You can also set them using the edit_config.ps1 script in the config folder on the psimage share.
- Within the config folder on the psimage share create a server.dns file that contain the DNS address for your FileWave server.
- Within the config folder on the psimage share create an app.token file that contain the base64 API token for a FileWave admin account that has at least permission to "Modify Custom Fields".
Pre-assigning computer names and disk images
- Browse to the config folder on the psimage share or Imaging volume of the USB thumb drive.
- Edit image_mappings.txt to pre-assign disk images and computernames to client devices by serial number. To avoid syntax issues from missing commas it is recommended you edit this file with a spreadsheet or CSV editing app. Entries should be in the format below. If no mapping is available or a client PC or the assigned disk image does not exist, you'll be prompted to enter a disk image name.
Serial Number,Computer Name,Image Name 1a2b3c4d,test-restore,image.wim
- There should be no spaces in the serial number, computer name, and image name fields and they should be separated by commas. Computernames should meet Windows naming requirements and should be 15 characters or less. If testing with a VMware VM, remove all spaces from the VM serial number when adding an entry for it. There must be one blank line at the end of the line.
- If you would like to set custom fields by their internal name, add them at the end after the image name. Custom fields need to be referenced by their internal names, followed by a colon, and then the value to set. The value for the custom field can have spaces in it, as illustrated in the example below. Only custom fields of the string data type are supported.
1a2b3c4d,test-restore,image.wim,school:Washington Elementary,grade:5,classroom:218,user_type:student
- If the assigned disk image is set to "capture" for a particular PC in image_mappings.txt while \config\mode.reimage is present, it will attempt to capture a disk image instead of restoring one.
Adding a Wi-Fi profile
For laptops that do not have a built-in ethernet port, you may prefer to switch to Wi-Fi as soon as possible for the post-imaging phase. This allows you to disconnect your USB ethernet dongle/dock so it can used to reimage additional PCs. Remember that post imaging requires network access so the FileWave client can send in an initial inventory to the FileWave server to trigger the creation of a client entry. This network access can be via wireless and does not have to be a wired connection.
- Configure a test PC to connect to your Wi-Fi.
- Run the following command to list available profiles.
netsh wlan show profiles
- Use the command below to export the desired profile to the current folder. Change ProfileName to the name of the profile from the list displayed in the previous step. Note that this will store the password for the wireless connection in clear text. The Wi-Fi profile will be deleted from the client system after import during post-imaging.
netsh wlan export profile name="ProfileName" key=clear folder="%cd%"
- Rename this profile to Wi-Fi.xml and copy it to the extra folder in the psimage share.
Changing configuration settings via edit_config.ps1
A text-based GUI is available for viewing and configuring many of the settings for PSImage. Navigate to the config folder on the psimages share, right-click edit_config.ps1, and choose "Run with PowerShell".
Custom Post-Imaging Actions (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. For the official Windows Imaging solution please see Network Imaging / IVS.
PSimage includes a mechanism for you to add post-imaging actions to the imaging workflow. These are executed by the to_do.bat file in the scripts folder of the psimage share and run with admin privileges under the context of the temporary local fwadmin account. This account is deleted at the end of the post-imaging phase. Custom post-imaging actions are enabled via 2 mechanisms:
- The contents of the extra folder in the psimage share is copied to c:\windows\temp\psimage. Place any files/folders here that you want to be copied to the reimaged PC and run during the post-imaging phase. The c:\windows\temp\psimage folder will be deleted automatically from the reimaged PC at the end of the post-imaging phase.
- Use the to_do.bat file in the scripts folder of the psimage share to trigger any built-in Windows utilities or executables/installers that have been copied to c:\windows\temp\psimage. Note that the post-imaging phase does not have access to the the psimage share but only to the files copied to c:\windows\temp\psimage. If there are any commands that must be run or apps that must be installed immediately ASAP after reimaging, add them to the extra folder and trigger them via to_do.bat as necessary.
Please take note of the tips outlined in the sample to_do.bat for how to trigger apps. There is a reboot at the end of the post-imaging phase so be sure to launch executables with "start /wait", particularly installers, so that the to_do.bat waits for them to finish before moving on to the next item in the script. Otherwise the system might reboot prematurely before your executable/installer has had a chance to finish running. If you need to deploy files to the hard disk of the reimaged PC, either include them in the disk image or copy them from c:\windows\temp\psimage, but do not move them as explained in the to_do.bat file.
REM Copy files from psimage folder to their intended locations instead of moving them so they inherit security
REM permission from the existing parent folder. Otherwise the owner will be system account and no users will be able to
REM access the files.
REM
REM If adding registry settings with reg add with a value that includes spaces and double quotes in it, add
REM outer quotes (to maintain the spaces) and backslash escape the inner quotes to maintain them in the registry
REM value.
REM reg add HKLM\Software\Microsoft\Windows\CurrentVersion\Run /v bginfo /t REG_SZ /d "\"C:\Program Files\bginfo\Bginfo64.exe\" \"C:\Program Files\bginfo\config.bgi\" /timer:0 /silent /nolicprompt"
REM
REM If launching an executable use start /wait so the script waits for your binary to finish before rebooting.
REM If the commandline includes spaces use start /wait "" <your_command_line>.
REM start /wait "" "c:\windows\temp\psimage\Firefox Setup 88.0.1.exe" /S
REM
REM For logging redirect the output for your commands with >> c:\windows\temp\psimage.log
REM start /wait "" "c:\windows\temp\psimage\Firefox Setup 88.0.1.exe" /S >> c:\windows\temp\psimage.log
REM
REM To redirect both stderr and stdout for your commands use >> c:\windows\temp\psimage.log 2>&1
REM start /wait "" "c:\windows\temp\psimage\Firefox Setup 88.0.1.exe" /S >> c:\windows\temp\psimage.log 2>&1
REM
REM ========ENTER YOUR POST-IMAGING COMMANDS BELOW========
echo Running to_do.bat >> c:\windows\temp\psimage.log
Restoring a Disk Image (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. For the official Windows Imaging solution please see Network Imaging / IVS.
In general it's recommended that you enable automatic conflict resolution to "Automatically resolve conflicts" with "Replace old client with new" when imaging clients to avoid device conflicts and unnecessary creation of new device client IDs.
- Boot from the USB thumb stick or network.
- You may be prompted to enter the name of the server hosting the psimage share, name of the share, and credentials depending on how config.ini is set up. If you are reimaging locally you will be presented directly with the main PSImage menu.
- At the main PSImage menu select the option to restore a disk image. If mode.reimage file is present, the main PSimage menu will be skipped and you will proceed immediately to restore an image.
- If there is an existing image association, the device will proceed directly to restoring a disk image. Otherwise you will be prompted for an image to restore and computername for the client PC. A list of available disk image names will be presented for you to choose from. Copy and paste the desired one at the prompt.
- After the client hard disk is wiped and restored, the client PC will reboot to kick off the post-imaging process. You may unplug the USB ethernet adapter as this point if a working Wi-Fi profile is present in the extra folder.
- On the first pass the PC will autologin with the fwadmin account, import the Wi-Fi profile, rename itself, and reboot.
- On the second pass PC will autologin, the FileWave client will be installed, kiosk customization will be applied if present, and a Windows firewall exception will be added. Client reboots after this.
- On the third pass PC will autologin, wait until an inventory has been successfully sent to the FileWave server, then run to_do.bat, and clean up by deleting the c:\windows\temp\psimage folder and the fwadmin account. Client reboots after this.
- User should be presented with login screen.
- Once the PC reboots and the FileWave client starts up it will connect to the FileWave server and install the "Postimaging - Set Custom Fields" fileset. This fileset will fail for client devices that have been reimaged via fileset as the requirement scripts conditions are not met because custom fields have already been set during the imaging process itself when the To Be Reimaged custom field was flipped back to false (unchecked). It only runs successfully for devices reimaged via USB, PXE, and ISO.
Importing the Imaging filesets and custom field
These items can also be found in the import folder in the psimage share.
- To Be Reimaged Custom Field.customfields.zip
- Reimage PC.fileset.zip
- Postimaging - Set Custom Fields.fileset.zip
- Import the "Reimage PC" fileset.
- Open its contents and browse to the boot folder.
- Add the boot.sdi file from the Boot folder from either the ISO file or USB thumb drive into the boot folder in the fileset.
- Add your customized boot.wim file to the same boot folder in the fileset.
- Add a copy of bcdedit.exe from the system32 folder of a Windows 10/11 computer into the same boot folder in the fileset. You might have to copy bcdedit.exe to your desktop first before being able to add it to the fileset from there.
- Import the "To Be Reimaged" Administrator custom field and assign it to all devices.
- Create a smart group with the selection criteria To Be Reimaged - equals - true.
- Associate the Reimage PC fileset to this smart group.
- Import the "Postimaging - Set Custom Fields" fileset.
- View its scripts, right click the set_custom_fields.bat activation script and pick Properties.
- Select the Executable tab and then the Environment Variables subtab.
- Edit the Value for the the TOKEN variable and replace it with your base64 API token.
- Associate this fileset to a smart group that contains all your Windows computers. The fileset has a requirements script that blocks it from installing except on client devices that have just been reimaged.
Restoring a disk image remotely via fileset
In general it's recommended that you enable automatic conflict resolution to "Automatically resolve conflicts" with "Replace old client with new" when imaging clients to avoid unnecessary creation of new device client IDs.
To reimage a client PC remotely, it's recommended you implement the following configuration changes to streamline the disk imaging process to minimize user input on the target computer. For example
- Edit the boot.wim file you're adding to the Reimage PC fileset to not include a password.txt. This way the local user at the remote computer does not have to authenticate.
- Ensure that the server directive in config.ini in the boot.wim file included in the Reimage PC fileset is set to the address of the server hosting the psimage share rather than "prompt", along with access credentials.
- Create a mode.reimage file in the config folder on the images share so that the imaging process automatically defaults to restoring a disk image. You can also set it using \config\edit_config.ps1.
- Add an imaging association for the PC based on serial number and specify a disk image to restore, computername, and any custom fields you would like to set in the image_mappings.txt file.
With the above settings in place, when a client PC boots from the fileset it will automatically connect to the psimage share and go straight to restoring the pre-assigned disk image.
To reimage a client PC that already has a functional FileWave client on it
- Set the To Be Reimaged custom field for that device to true by enabling the checkbox next to it and update model. This will cause it to appear in the smart group to which the imaging fileset has been assigned.
- Connect to the remote client PC with TeamViewer if the PC is not next to you and you would like to monitor what's happening. The PC will reboot into Windows PE to reimage.
- As soon as the image restoration process starts, the To Be Reimaged custom field for that device will automatically be unchecked/reset back to false, taking it out of the smart group that the reimaging fileset is assigned to so that it does not attempt to reimage again.
- If any custom fields are present in image_mappings.txt for this client PC they will be set on the FileWave server.
- If there is an existing image association the device will proceed directly to restoring a disk image. Otherwise you will be prompted for an image to restore and computername for the client PC. A list of available disk image names will be presented for you to choose from. Copy and paste the desired one at the prompt.
- After the client hard disk is wiped and restored, the client PC will reboot to kick off the post-imaging process. You may unplug the USB ethernet adapter as this point if a working Wi-Fi profile is present in the extra folder.
- On the first pass the PC will autologin, import the Wi-Fi profile, rename itself, and reboot.
- On the second pass PC will autologin, the FileWave client will be installed, kiosk customization will be applied if present, and a Windows firewall exception will be added. Client reboots after this.
- On the third pass PC will autologin, wait until an inventory has been successfully sent to the FileWave server, then run to-do.bat, and clean up by deleting the c:\windows\temp\psimage folder and the fwadmin account. Client reboots after this.
- User should be presented with login screen.
Tracking Imaging and Adding Drivers (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. For the official Windows Imaging solution please see Network Imaging / IVS.
View imaging history
Browse to the logs folder on the psimage share or the Imaging volume of the USB thumb drive, right-click search_history.ps1, and choose "Run with PowerShell". You may need to expand the window sideways to adequately view the query results. Transcripts of each image restore operation are logged in the \logs\restore folder and named __
Beginning and ending imaging times are written to registry of reimaged client at HKLM\Software\PSImage. The duration here only includes the post-imaging time. The name of image restored is also written here. Custom field data specified in image_mappings.txt will also be written here if the client device is reimaged using some other methods besides via fileset.
A log of the post-imaging phase is written to c:\windows\temp\psimage.log on the restored client itself. When adding custom post-imaging actions in to_do.bat have their output directed to this psimage.log file for troubleshooting purposes.
Adding drivers to boot.wim
If you find that there is no network access or degraded network access when booted into Windows PE, you may need to inject the appropriate Windows 10 NIC drivers for some of your PC models.
- Create c:\windows\temp\driver.
- On a working PC of the model you are having an issue with boot into Windows and open a CMD prompt with admin privileges to export all 3rd party drivers. If you have already extracted drivers for this PC model then just check the models folder on your psimage share for the ethernet NIC driver.
dism /online /export-driver /destination:c:\windows\temp\drivers
- View c:\windows\temp\drivers or \\psimage\models and check folder names to determine which one holds the ethernet NIC drivers for your PC. Copy the folder containing your ethernet NIC driver to your desktop.
- Mount your boot.wim image using the instructions from Building Your Imaging Environment (PSImage).
- Inject the drivers for your ethernet NIC with
dism /image:C:\WinPE_amd64\mount /add-driver /driver:C:\fully\qualified\path\to\driver\folder" /recurse
- Unmount and commit your changes to boot.wim using the instructions from Building Your Imaging Environment (PSImage).