Creating a Custom Device

One of the great features in Enterprise is Windows To Go. This feature allows you to take your Windows 8 install anywhere with you and run it from any PC with compatible hardware and the ability to boot from USB. This allows you to use the same PC from home or work, and makes working remotely a snap! You can install all of your management apps on one PC, then with a VPN or remote connection, have the same applications and manageability that you would as if you were sitting in your office. You can also create Windows To Go pen drives and essentially keep a bunch of “computers” in your desk drawer! This is a great option when rolling out Windows 8 in an enterprise without needing to overwrite an old PC, it also presents a lot of great testing opportunities!

Microsoft only supports Windows To Go on a select list of certified devices. You can find that listing on their website: http://www.microsoft.com/en-us/windows/enterprise/products-and- technologies/devices/windowstogo.aspx

Creating a Windows To Go device is pretty simple. All that you need is a system running Windows 8 Enterprise and the Windows 8 Enterprise installation media. Then you can simply open the , click on the Windows To Go option, select your pen drive and wait for the magic wizard to complete. However, that only provides you a base Windows 8 image to work with. I am writing this to aid you in creating a custom Windows To Go image that can be easily pumped out to multiple pen drives.

Like any deployment you need a pristine system that you will use to configure your Windows 8 image and a technician PC that you will use to push out your Windows To Go pen drives. We will assume that you have already created your Windows 8 image, installing all of your desired applications and Windows Updates.

Items you will need:  PC to be used as your Pristine Windows 8 Machine  PC to be used as your Technician Windows 8 Machine  Pen Drive to be used as a bootable Windows 8 PE drive o At least 1GB  USB Hard Drive for capturing your Windows To Go image o At least the same size as your Pristine Windows 8 Install  Pen Drive to be used as your Windows To Go Pen Drive, meeting Microsoft’s certification specs.

Steps: Creating your pristine Image Creating a bootable Windows 8 PE Pen Drive Capturing the image from your pristine system Creating the custom Windows To Go Pen Drive Creating your pristine image:

Once you have the pristine computer completely setup and tested you want to the system. You can use an unattended file, but for this example we will just use a generic sysprep command:

Run Command Prompt or PowerShell as an administrator from the C:\Windows\System32\Sysprep directory and run the following command to sysprep and shutdown the PC: CMD: sysprep.exe –oobe –generalize –shutdown PowerShell: .\sysprep.exe –oobe –generalize –shutdown

Once the system has been shut down you will need to capture an image of it and then push that image to your Windows To Go pen drive. Creating a bootable Windows 8 PE Pen Drive:

In keeping this in line with all things Microsoft we will use the Windows 8 Assessment and Deployment Kit (ADK). This used to be called the Windows Automated Installation Kit (WAIK) in previous version of Windows. You will need to install the Deployment Tools and Windows PE and then create a bootable Pen Drive to boot your pristine system with in order to capture the image.

Install Windows ADK onto your technician PC: You can download this from the following website: http://www.microsoft.com/en-us/download/details.aspx?id=5753

Once downloaded you can start the installation by running the adksetup.exe From the ‘Select the features…’ screen you need to select the Deployment Tool and Windows Preinstallation Environment (Windows PE) features. Once the installation is complete you are ready to start creating your bootable Windows 8 PE Pen Drive.

Start the Deployment and Imaging Tools Environment as an Administrator.

Now we are going to add in some packages to the Windows PE image. This isn’t necessary, but it does add in some extra features to your PE image.  Create a C:\WinPE_amd64 folder.  Copy the winpe.wim file from C:\Program Files (x86)\Windows Kits\8.0\Assessment and Deployment Kit\Windows Preinstallation Environment\amd64 to the C:\WinPE_amd64 folder created above.  Create a C:\Mount folder to mount the PE image to.  Mount the boot image using the following command in the Deployment Tools and Imaging Environment window: o imagex /mount C:\WinPE_amd64\winpe.wim 1 C:\Mount  Add the following components to the boot image by running the following commands: (I found this easier to do by creating and executing a batch file) o cd /d "C:\Program Files (x86)\Windows Kits\8.0\Assessment and Deployment Kit\Windows Preinstallation Environment\amd64\WinPE_OCs"

dism /image:C:\Mount /add-package /packagepath:"WinPE- Scripting.cab" dism /image:C:\Mount /add-package /packagepath:"en- us\WinPE-Scripting_en-us.cab"

dism /image:C:\Mount /add-package /packagepath:"WinPE- WMI.cab" dism /image:C:\Mount /add-package /packagepath:"en- us\WinPE-WMI_en-us.cab"

dism /image:C:\Mount /add-package /packagepath:"WinPE- MDAC.cab" dism /image:C:\Mount /add-package /packagepath:"en- us\WinPE-MDAC_en-us.cab"

dism /image:C:\Mount /add-package /packagepath:"WinPE- HTA.cab" dism /image:C:\Mount /add-package /packagepath:"en- us\WinPE-HTA_en-us.cab"

dism /image:C:\Mount /add-package /packagepath:"WinPE- NetFx4.cab" dism /image:C:\Mount /add-package /packagepath:"en- us\WinPE-NetFx4_en-us.cab"

dism /image:C:\Mount /add-package /packagepath:"WinPE- PowerShell3.cab" dism /image:C:\Mount /add-package /packagepath:"en- us\WinPE-PowerShell3_en-us.cab"

dism /image:C:\Mount /add-package /packagepath:"WinPE- DismCmdlets.cab" dism /image:C:\Mount /add-package /packagepath:"en- us\WinPE-DismCmdlets_en-us.cab"  Commit the changes to the boot image: o imagex /unmount /commit C:\Mount  Now we need to copy the newly edited winpe.wim file back over the original file located here: C:\Program Files (x86)\Windows Kits\8.0\Assessment and Deployment Kit\Windows Preinstallation Environment\amd64 o I would recommend renaming the original file to winpe.wim.orig or similar.

Now you need to create a working copy of the Windows PE files, from here you can specify x86, amd64 or arm to suite your needs (for this example I chose amd64):  Run the following command from the Deployment and Imaging Tools Environment as an Administrator. o Copype amd64 C:\WinPE_amd64  Install the unpacked Windows PE files to the USB Flash drive, specifying the drive letter (in my case, G:\): o MakeWinPEMedia /UFD C:\WinPE_amd64 G:

Now you have a bootable Windows 8 PE pen drive to boot your pristine computer from.

Capturing the image from your pristine system:

Boot your Pristine PC from your newly created Windows 8 PE pen drive.

Now you need to record the drive letters of your Pristine Computer and External Hard Drive. In my case my Pristine drive was F:\ and my External Hard Drive was D:\

From the Windows 8 PE command prompt run the following to capture your image: DISM /Capture-Image /ImageFile:D:\WindowsToGo.wim /CaptureDir:F:\ /Name:”Windows To Go”

Now wait for the image to be created on your external hard drive, this may take a while so feel free to browse the Spiceworks Community from your technician PC!

Once the image capture is complete you can shut down your Pristine PC by typing exit into the command prompt.

Creating the custom Windows To Go Pen Drive:

Start off by plugging your Windows To Go Pen Drive and the external hard drive containing your Prinstine Image ‘WindowsToGo.wim’ file into your Technician PC.

Open a command prompt as an administrator and prepare your Windows To Go Pen Drive for creation:  Start a command prompt as an administrator  Start Disk Part by typing diskpart into the command line  Now you need to identify your Pen Drive, type list disk into Disk Part and locate the disk with the same amount of space as your Windows To Go Pen Drive, in my case it was Disk 2.  Type in the following commands to create a new partition: o select disk 2 clean create partition primary select partition 1 active format quick fs= assign exit  Now you need to apply the Pristine image on your external hard drive to your Windows 2 Go Pen Drive: o Run the following command to apply the image: DISM /Apply-Image /ImageFile:G:\WindowsToGo.wim /Index:1 /ApplyDir:F:\ o This step is going to take a while, so feel free to cook up some bacon and surf the Spiceworks Forums!  Now you need to setup the boot configuration so that it will boot as a Windows To Go device: o F:\Windows\System32\bcdboot F:\Windows /f ALL /s F:  Now you should create a SAN policy that will prevent the Windows To Go device from automatically bringing any internally connected disks online. This adds extra security by preventing access to local internal discs by default. However, they can still be seen from Disk Management. Put the following into a san_policy.xml file in the root of the Windows directory on the Windows To Go device: o 4 4

o Run the following command to apply the policy: . Dism /image:F:\ /Apply-Unattend:F:\san_policy.xml  Create an unattend.xml answer file that disables the use of Windows Recovery Environment and place it in the F:\Windows\System32\Sysprep folder on your Windows To Go device: o true true

You can now take your newly created Windows To Go Pen Drive and boot to it from any compatible hardware that permits you to boot from a USB Drive.

Enjoy!

References These instructions have been created using examples from the following websites: Deploy Windows To Go in Your Organization: http://technet.microsoft.com/en-us/library/jj721578.aspx How to Create a WIM System Image File with WindowsAIK and WindowsPE http://www.danscourses.com/Windows-7/how-to-create-a-wim-system-image-file-with-windowsaik-and- windowspe.html Creating a WinPE boot image with .NET Framework and PowerShell http://www.deploymentresearch.com/Research/tabid/62/EntryId/41/Windows-8-Preview-Howto-Creating-a- WinPE-boot-image-with-NET-Framework-and-PowerShell.aspx