Pages

Showing posts with label wim. Show all posts
Showing posts with label wim. Show all posts

Wednesday, 26 June 2013

Creating a Windows 2 Go USB device

So our IT Director managed to break his Windows 2 Go (W2G) pen I created for him a few months back.  I kicked myself that I hadn't blogged the steps back then so as I've had to recreate it I'm taking the opportunity to blog it now.

The Windows 8 W2G GUI didn't let me see my .wim - I'm guessing this is due to the size of it.  I opted to build it via Powershell which worked a charm.

I used a Windows8 wim that I'd captured from our corporate build - I already have this so this is one of my assumptions that you will have it too.

I also have an approved Windows 2 Go USB pen (Kingston DataTraveler Workspace 32GB)

These are the devices currently supported by Microsoft:



Also you will need to change your BIOS boot order to boot to USB first.

Instructions

Assumptions:
  • You already have Windows 8 image (.wim) file - OOTB or captured.
  • You have an approved USB device from the list above.
1. From a Windows 8 machine fire up an elevated Powershell prompt.
2. The following commands will prepare your USB device to be used with W2G.  Type them in the Powershell window:

#The following command will set $Disk to all USB drives with >20 GB of storage

$Disk = Get-Disk | Where-Object {$_.Path -match "USBSTOR" -and $_.Size -gt 20Gb -and -not $_.IsBoot }

#Clear the disk. This will delete any data on the disk. (and will fail if the disk is not yet initialized. If that happens, simply continue with ‘New-Partition…) Validate that this is the correct disk that you want to completely erase.

#

# To skip the confirmation prompt, append –confirm:$False

Clear-Disk –InputObject $Disk[0] -RemoveData

# This command initializes a new MBR disk

Initialize-Disk –InputObject $Disk[0] -PartitionStyle MBR

# This command creates a 350 MB system partition

$SystemPartition = New-Partition –InputObject $Disk[0] -Size (350MB) -IsActive

# This formats the volume with a FAT32 Filesystem

# To skip the confirmation dialog, append –Confirm:$False

Format-Volume -NewFileSystemLabel "UFD-System" -FileSystem FAT32 `

-Partition $SystemPartition

# This command creates the Windows volume using the maximum space available on the drive. The Windows To Go drive should not be used for other file storage.

$OSPartition = New-Partition –InputObject $Disk[0] -UseMaximumSize

Format-Volume -NewFileSystemLabel "UFD-Windows" -FileSystem NTFS `

-Partition $OSPartition

# This command assigns drive letters to the new drive, the drive letters chosen should not already be in use.

Set-Partition -InputObject $SystemPartition -NewDriveLetter "S"

Set-Partition -InputObject $OSPartition -NewDriveLetter "W"

# This command toggles the NODEFAULTDRIVELETTER flag on the partition which

prevents drive letters being assigned to either partition when inserted into a different machine.

Set-Partition -InputObject $OSPartition -NoDefaultDriveLetter $TRUE


3. Now we need that Windows 8 image.  For the sake of this example we'll say the image is on C:\ and it's called windows8.wim.
We will use DISM (Deployment Image Servicing Management) to aplpy the image to the USB drive - it could take 30 mins or longer so time to sti back and enjoy a brew...

dism /apply-image /imagefile:c:\windows8.wim /index:1 /applydir:W:\

4. Now we will use BCDBOOT to move the boot componants to the sys partition.

W:\Windows\System32\bcdboot W:\Windows /f ALL /s S:

5. To prevent the native HDD from being fired up whilst within W2G we need a policy in place.  Here's one I prepared earlier - copy the san_policy.xml file to the root of your USB device: http://sdrv.ms/149ZHV1

6. Apply the policy file we just created by running this command:

Dism.exe /Image:W:\ /Apply-Unattend:W:\san_policy.xml

7. Create an answer file (unattend.xml) that disables the use of Windows Recovery Environment with Windows To Go. You can use the code from the sample here to create a new answer file or you can paste it into an existing answer file (or just use the file itself):

8. Once the answer file has been saved, copy unattend.xml into the sysprep folder on the Windows To Go drive (for example, W:\Windows\System32\sysprep\)
Note
Setup unattend files are processed based on their location. Setup will place a temporary unattend file into the %systemroot%\panther folder which is the first location that setup will check for installation information.  You should make sure that folder does not contain a previous version of an unattend.xml file to ensure that the one you just created is used.


Now boot to your new shiney Windows2Go boot device :)

docN


Wednesday, 12 October 2011

PXE Boot pulling the wrong Windows PE wim

 If like me you are working with multiple architectures of Microsoft OS there will be occasions where you would like to push out a 64bit OS - more so in recent years due to the increasing popularity of 64bit platforms.

SCCM is my weapon of choice but I have found that sometimes even if a machine is placed in the 64bit deployment collection with the 64bit deployment task sequnce advertsied; it will still throw out the 32bit PE.

This is if a collection has multiple advertisments it will churn out the latest image to be advertised.  To get around this I found a great article on "Network Steve" that I have included below:

I had the exact same problem;
I wanted to be able to boot x86 or x64 Unknown Computers and image them. I have figured a very simple and erffective work around to this problem of the last advertised task winning...
I edited the query in the Unknown Computers collection to add: and Name LIKE "%x86%"
here's the complete query for the "Unknown Computers" collection
select SMS_R_UNKNOWNSYSTEM.ResourceID,SMS_R_UNKNOWNSYSTEM.ResourceType,SMS_R_UNKNOWNSYSTEM.Name,SMS_R_UNKNOWNSYSTEM.Name,SMS_R_UNKNOWNSYSTEM.Name from SMS_R_UnknownSystem where Decommissioned = "0" and Name LIKE "%x86%"
Then I created a new collection called "Unknown Computers x64" and used the following query:
select SMS_R_UNKNOWNSYSTEM.ResourceID,SMS_R_UNKNOWNSYSTEM.ResourceType,SMS_R_UNKNOWNSYSTEM.Name,SMS_R_UNKNOWNSYSTEM.Name,SMS_R_UNKNOWNSYSTEM.Name from SMS_R_UnknownSystem where Decommissioned = "0" and Name LIKE "%x64%"
Next, Advertise your x86 Task Sequences to the Unknown Computers query and your x64 Task Sequences to the Unknown Computers x64 query.
Now, as long as the computer is not in the SCCM database, when you PXE boot it will get the correct image.
Good LuckDoug

http://www.networksteve.com/enterprise/topic.php/Boot_Image_pulling_wrong_Windows_PE_interface/?TopicId=25850&Posts=4