How to create UEFI bootable USB media to install Windows Server 2016

Since Windows Server 2016 has been released, I grabbed the RTM ISO file and wanted to install a new server using a USB stick.

I configured the BIOS settings of the server to only boot UEFI and disabled the legacy boot.

Some of the key points to bear in mind:

  • A USB stick with more than 5.3GB is required
  • UEFI requires a FAT32 partition
  • FAT32 has some serious limitations and the size of the install.wim file exceeds those limits. This file requires therefore to be split into multiple more suitable parts

More on this here: https://blogs.technet.microsoft.com/askcore/2013/03/20/creating-bootable-usb-drive-for-uefi-computers/

Here’s how I created my USB boot media compatible with UEFI using PowerShell:

Advertisements

22 thoughts on “How to create UEFI bootable USB media to install Windows Server 2016

  1. BTW : you can use the Windows 7 USB/DVD download tool from Microsoft to successfully ‘burn’ the ISO Image to you USB drive.

  2. Hi,

    i am having a bit of an issue, i ran the script, it started , when it got to formatting the USB , it opened the windows format option and then it crashes.

    how can i fix that ?

    • PS C:\Users\phoareau\Desktop> .\iossplitwin2k16.ps1

      Confirm
      Are you sure you want to perform this action?
      This will erase all data on disk 2 “SanDisk Ultra USB 3.0”.
      [Y] Yes [A] Yes to All [N] No [L] No to All [S] Suspend [?] Help (default is “Y”): y

      Number Friendly Name Serial Number HealthStatus OperationalStatus Total Size Partition
      Style
      —— ————- ————- ———— —————– ———- ———-
      2 SanDisk Ul… 4C531001621109117444 Healthy Online 115.69 GB GPT
      Format-Volume : Size Not Supported
      Activity ID: {8f7de908-7d9c-4072-99b3-d216b2a88cff}
      At C:\Users\phoareau\Desktop\iossplitwin2k16.ps1:22 char:1
      + Format-Volume -FileSystem FAT32
      + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      + CategoryInfo : NotSpecified: (StorageWMI:ROOT/Microsoft/…age/MSFT_Volume) [Format-Volume], CimExcepti
      on
      + FullyQualifiedErrorId : StorageWMI 4097,Format-Volume

      You cannot call a method on a null-valued expression.
      At C:\Users\phoareau\Desktop\iossplitwin2k16.ps1:53 char:14
      + ParseName(“$($volume.DriveLetter):”).InvokeVerb(‘Eject’)
      + ~~~~~~~~~~~~~~~~~~~
      + CategoryInfo : InvalidOperation: (:) [], RuntimeException
      + FullyQualifiedErrorId : InvokeMethodOnNull

    • To anyone else getting this error, I got it when trying to use a USB drive that was larger than the FAT32 max size of 32gb. Works like a charm with a drive smaller than that.

    • Put line 52 and 53 in one single line. Make sure there’s no extra (whitespace) character at the end of the line 52.

      (New-Object -comObject Shell.Application).NameSpace(17).ParseName("$($volume.DriveLetter):").InvokeVerb('Eject')
      
  3. One more thing to add, as my cardreader has many ports, so I have sevelart USB drives? but only one online (where card is inserted).
    So I just need to add one where clause:
    Where OperationalStatus -eq Online

  4. Pingback: Create Windows Installation Media to Boot via USB in UEFI Mode | Automatica

  5. What a time-saver, thanks a ton. I have dark memories of having to split the WIM file before but it has been so long I had to reinvent the wheel for my 2016 install and this hit the spot. Really fast.

  6. Pingback: Create Windows Installation Media to Boot via USB in UEFI Mode – Automatica

  7. I’m getting this as well. I haven’t been able to work around. Each time I run it I receive Error 87 and it can’t continue. It copies about 545MB and errors out.

    Deployment Image Servicing and Management tool
    Version: 6.3.9600.17031
    Error: 87
    An error occurred while processing the command.
    Ensure that the command-line arguments are valid. For more information, review the log file.
    The DISM log file can be found at C:\WINDOWS\Logs\DISM\dism.log

    Script executed from Windows 8 machine with windows powershell version 4

    Error info from the log:

    2017-09-09 13:24:23, Info DISM DISM.EXE: Got the collection of providers. Now enumerating them to build the command table.
    2017-09-09 13:24:23, Info DISM DISM.EXE: Attempting to add the commands from provider: DISM Log Provider
    2017-09-09 13:24:23, Info DISM DISM.EXE: Attempting to add the commands from provider: FolderManager
    2017-09-09 13:24:23, Info DISM DISM.EXE: Attempting to add the commands from provider: WimManager
    2017-09-09 13:24:23, Info DISM DISM.EXE: Succesfully registered commands for the provider: WimManager.
    2017-09-09 13:24:23, Info DISM DISM.EXE: Attempting to add the commands from provider: VHDManager
    2017-09-09 13:24:23, Info DISM DISM.EXE: Attempting to add the commands from provider: GenericImagingManager
    2017-09-09 13:24:23, Info DISM DISM.EXE: Succesfully registered commands for the provider: GenericImagingManager.
    2017-09-09 13:24:23, Info DISM DISM.EXE: Attempting to add the commands from provider: Compatibility Manager
    2017-09-09 13:24:23, Info DISM DISM.EXE: Succesfully registered commands for the provider: Compatibility Manager.
    2017-09-09 13:24:23, Info DISM DISM Provider Store: PID=2424 TID=4992 Getting Provider WimManager – CDISMProviderStore::GetProvider
    2017-09-09 13:24:23, Info DISM DISM Provider Store: PID=2424 TID=4992 Provider has previously been initialized. Returning the existing instance. – CDISMProviderStore::Internal_GetProvider
    2017-09-09 13:24:23, Error DISM DISM WIM Provider: PID=2424 TID=4992 base\ntsetup\opktools\dism\providers\wimprovider\dll\wimmanager.cpp:1769 – CWimManager::SplitFile(hr:0x80070057)
    2017-09-09 13:24:23, Error DISM DISM WIM Provider: PID=2424 TID=4992 base\ntsetup\opktools\dism\providers\wimprovider\dll\wimmanager.cpp:4982 – CWimManager::InternalCmdSplit(hr:0x80070057)
    2017-09-09 13:24:23, Error DISM DISM WIM Provider: PID=2424 TID=4992 Error executing command – CWimManager::InternalExecuteCmd(hr:0x80070057)
    2017-09-09 13:24:23, Error DISM DISM WIM Provider: PID=2424 TID=4992 base\ntsetup\opktools\dism\providers\wimprovider\dll\wimmanager.cpp:2273 – CWimManager::ExecuteCmdLine(hr:0x80070057)
    2017-09-09 13:24:23, Error DISM DISM.EXE: WimManager processed the command line but failed. HRESULT=80070057
    2017-09-09 13:24:23, Info DISM DISM.EXE: Image session has been closed. Reboot required=no.
    2017-09-09 13:24:23, Info DISM DISM.EXE:
    2017-09-09 13:24:23, Info DISM DISM.EXE:
    2017-09-09 13:24:23, Info DISM DISM.EXE:
    2017-09-09 13:24:23, Info DISM DISM Provider Store: PID=2424 TID=4992 Found the OSServices. Waiting to finalize it until all other providers are unloaded. – CDISMProviderStore::Final_OnDisconnect
    2017-09-09 13:24:23, Info DISM DISM Provider Store: PID=2424 TID=4992 Disconnecting Provider: FolderManager – CDISMProviderStore::Internal_DisconnectProvider
    2017-09-09 13:24:23, Info DISM DISM Provider Store: PID=2424 TID=4992 Disconnecting Provider: WimManager – CDISMProviderStore::Internal_DisconnectProvider
    2017-09-09 13:24:23, Info DISM DISM Provider Store: PID=2424 TID=4992 Disconnecting Provider: VHDManager – CDISMProviderStore::Internal_DisconnectProvider
    2017-09-09 13:24:23, Info DISM DISM Provider Store: PID=2424 TID=4992 Disconnecting Provider: GenericImagingManager – CDISMProviderStore::Internal_DisconnectProvider
    2017-09-09 13:24:23, Info DISM DISM Provider Store: PID=2424 TID=4992 Disconnecting Provider: Compatibility Manager – CDISMProviderStore::Internal_DisconnectProvider
    2017-09-09 13:24:23, Info DISM DISM Provider Store: PID=2424 TID=4992 Releasing the local reference to DISMLogger. Stop logging. – CDISMProviderStore::Internal_DisconnectProvider

    • Thanks for reporting the issue. You should try using a more recent version of DISM. You can install the Windows 10 ADK that contains a more recent version and run dism.exe located in the ADK.
      If you don’t want to install the ADK on Windows 8, you can run dism.exe from Windows 10.

  8. Running on a windows 8 workstation via powershell 4.0. receiving error 87 and it fails every time. It only copies about 544mb and then fails with the following in the log file and unable to continue:

    CDISMProviderStore::Internal_LoadProvider
    2017-09-09 13:43:13, Info DISM DISM.EXE: Got the collection of providers. Now enumerating them to build the command table.
    2017-09-09 13:43:13, Info DISM DISM.EXE: Attempting to add the commands from provider: DISM Log Provider
    2017-09-09 13:43:13, Info DISM DISM.EXE: Attempting to add the commands from provider: FolderManager
    2017-09-09 13:43:13, Info DISM DISM.EXE: Attempting to add the commands from provider: WimManager
    2017-09-09 13:43:13, Info DISM DISM.EXE: Succesfully registered commands for the provider: WimManager.
    2017-09-09 13:43:13, Info DISM DISM.EXE: Attempting to add the commands from provider: VHDManager
    2017-09-09 13:43:13, Info DISM DISM.EXE: Attempting to add the commands from provider: GenericImagingManager
    2017-09-09 13:43:13, Info DISM DISM.EXE: Succesfully registered commands for the provider: GenericImagingManager.
    2017-09-09 13:43:13, Info DISM DISM.EXE: Attempting to add the commands from provider: Compatibility Manager
    2017-09-09 13:43:13, Info DISM DISM.EXE: Succesfully registered commands for the provider: Compatibility Manager.
    2017-09-09 13:43:13, Info DISM DISM Provider Store: PID=2868 TID=3732 Getting Provider WimManager – CDISMProviderStore::GetProvider
    2017-09-09 13:43:13, Info DISM DISM Provider Store: PID=2868 TID=3732 Provider has previously been initialized. Returning the existing instance. – CDISMProviderStore::Internal_GetProvider
    2017-09-09 13:43:13, Error DISM DISM WIM Provider: PID=2868 TID=3732 base\ntsetup\opktools\dism\providers\wimprovider\dll\wimmanager.cpp:1769 – CWimManager::SplitFile(hr:0x80070057)
    2017-09-09 13:43:13, Error DISM DISM WIM Provider: PID=2868 TID=3732 base\ntsetup\opktools\dism\providers\wimprovider\dll\wimmanager.cpp:4982 – CWimManager::InternalCmdSplit(hr:0x80070057)
    2017-09-09 13:43:13, Error DISM DISM WIM Provider: PID=2868 TID=3732 Error executing command – CWimManager::InternalExecuteCmd(hr:0x80070057)
    2017-09-09 13:43:13, Error DISM DISM WIM Provider: PID=2868 TID=3732 base\ntsetup\opktools\dism\providers\wimprovider\dll\wimmanager.cpp:2273 – CWimManager::ExecuteCmdLine(hr:0x80070057)
    2017-09-09 13:43:13, Error DISM DISM.EXE: WimManager processed the command line but failed. HRESULT=80070057
    2017-09-09 13:43:13, Info DISM DISM.EXE: Image session has been closed. Reboot required=no.
    2017-09-09 13:43:13, Info DISM DISM.EXE:
    2017-09-09 13:43:13, Info DISM DISM.EXE:
    2017-09-09 13:43:13, Info DISM DISM.EXE:
    2017-09-09 13:43:13, Info DISM DISM Provider Store: PID=2868 TID=3732 Found the OSServices. Waiting to finalize it until all other providers are unloaded. – CDISMProviderStore::Final_OnDisconnect
    2017-09-09 13:43:13, Info DISM DISM Provider Store: PID=2868 TID=3732 Disconnecting Provider: FolderManager – CDISMProviderStore::Internal_DisconnectProvider
    2017-09-09 13:43:13, Info DISM DISM Provider Store: PID=2868 TID=3732 Disconnecting Provider: WimManager – CDISMProviderStore::Internal_DisconnectProvider
    2017-09-09 13:43:13, Info DISM DISM Provider Store: PID=2868 TID=3732 Disconnecting Provider: VHDManager – CDISMProviderStore::Internal_DisconnectProvider
    2017-09-09 13:43:13, Info DISM DISM Provider Store: PID=2868 TID=3732 Disconnecting Provider: GenericImagingManager – CDISMProviderStore::Internal_DisconnectProvider
    2017-09-09 13:43:13, Info DISM DISM Provider Store: PID=2868 TID=3732 Disconnecting Provider: Compatibility Manager – CDISMProviderStore::Internal_DisconnectProvider
    2017-09-09 13:43:13, Info DISM DISM Provider Store: PID=2868 TID=3732 Releasing the local reference to DISMLogger. Stop logging. – CDISMProviderStore::Internal_DisconnectProvider

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s