EV Reach - IT Process Automation Tutorial - Re-imaging a Windows Machine Remotely With WDS

Last modified on 2023/07/12 14:36

ProcessAutomationsCaution

   These tutorial is for demonstration purposes. Please test all Scope Actions before deploying them into production.

   

  • This scope action involves different Windows based technologies that are outside the scope of EV Reach.
  • We HIGHLY recommend that you test this method in a lab (specifically a virtual machine with a revertible snapshot if possible) as you will be modifying the boot records and could render the machine un-bootable if any step in this article is over looked.

Objectives

In this tutorial, you will learn to use EV Reach's Process Automation framework and your WDS configuration to re-image a live Windows OS. Once this tutorial is complete, simply use the scope action or custom action to re-image any Windows machine.

Best Practice

ProcessAutomationsBestPractice

Prerequisites

  • Live Windows OS - This method will only work against a Windows OS that is live and bootable to the desktop.
  • Windows Deployment Services Server - You will need a pre-existing WDS environment with pre-configured Boot & OS Images. (Getting Started with WDS)
  • Windows Assessment and Deployment Kit (Windows ADK) - You will need to have both the Deployment Tools (Deployment and Imaging Tools Environment) and the Windows Pre-installation Environment installed from the Kit. (Windows ADK)
  • Administrative access - to both the WDS environment and the machine you are re imaging.

Step by Step Tutorial

Step 1: Preparing the Environment

1. Extract the WinPE Discovery image (WinPE boot.wim) from one of your OS boot images on your WDS server.

  • Right-click the boot image of the OS you want to deploy.
  • Click Create Discover Image.
     

See this video: It will guide you through extracting the boot.wim needed for this method to work properly.

Caution

  • Take note of the boot image Architecture that you are creating this Discovery image from(see below image). Then save this as "boot.wim", we will be using it down the line in this tutorial.
  • Make sure to add your WDS server name in the bottom section of the wizard titled "Enter the name of the Windows Deployment Services server...."

          tutorial-wds-2.png

2. Configuring and injecting the AutoUnattend.xml file into the boot.wim.

Refer to Sample WDS Client Answer Files. You can simply copy paste the Sample xml on the technet site titled "Sample Windows Deployment Services client unattend file" as shown below.

  • Modify this answer file with notepad and enter the appropriate settings/credentials according to your WDS setup.
  • Save this file as AutoUnattend.xml.
  • After creating the AutoUnattend.xml, store it in a safe place as we will need it for the next step.

Caution: In the AutoUnattend.xml, there will be some lines that end withprocessorArchitecture="x86." Change this according to the architecture of the Discovery image that was extracted in Step 1. If this does not match the architecture of the discovery image, the automated image will fail causing you to manually go to the machine and go through the Windows Setup prompts.

          tutorial-wds-4.png

3. Insert AutoUnattend.xml into WinPE Discovery Image to prepare the new WinPE directory structure.

  • Use the DISM command to mount the boot.wim image created in Step 1.
    Refer to the following TechNet article on Modifying a WIM Image Using DISM via the Mounting an Image Section.
  • After mounting the boot.wim that was created in Step 1, you will see the following in your Mount Directory:

          tutorial-wds-5.png

  • Simply copy paste the autounattend.xml file into this directory. The result will be the following:

          tutorial-wds-7.png

  • Unmount the image with the /commit switch as mentioned in the section titled Unmounting an Image in the TechNet article above.
  • Store this modified boot.wim file as we will be using it in the next step.

4. Create WinPE Directory(x86 or x64).

  • On the machine that has the Windows ADK, go to All Programs > Windows Kits > Windows ADK and right-click Deployment and Imaging Tools Environment and select Run as Administrator. 
  • Run one of the below commands based on the Architecture type of the OS you are going to push to your machines:
    • For AMD64(64-bit) images: copype amd64 C:\WinPE
    • For x86(32-bit) images: copype x86 C:\WinPE
  • After the command is completed your C:\WinPE directory will look as follows:

          tutorial-wds-10.png

  • Delete the folders titled fwfiles & mount.
  • Now inside of the folder called media you will see the below folders:

          tutorial-wds-12.png

  • Select all the files and folders in C:\WinPE\media and cut them. Then paste them into C:\WinPE, one level above. 
  • Delete the, now empty media folder.
  • Your final C:\WinPE folder should look like the below:

          tutorial-wds-13.png

5. Copy the boot.wim created in Step 1 into the C:\WinPE\Sources directory.

There will be another file with the same name inside of it, simply overwrite/delete this file.
 

Step 2: Deploying Images with EV Reach

1. Once the WinPE directory is ready, use a EV Reach Scope or Custom Action to copy the WinPE directory locally.

2. Run the batch file to start the imaging process.

Tags:
Powered by XWiki © EasyVista 2024