After long night of digging over the web, looking for precise solution to implement BIOS and UEFI PXE boot capabilities for imaging purposes, I have decided to break it into few steps and provide a script that I wrote to automate this procedure.

Your WDS server has a couple of files that can be delivered to client which is initiating a PXE boot, but unless you configure your DHCP server properly to achieve this, it is not going to be possible out of the box. In my scenario WDS and DHCP roles are on different servers. There are few Vendor classes that need to be created and assigned to policies to match the UEFI x64, x86 and BIOS x64, x86 architectures. You can find my script on Microsoft Technet Gallery – HERE. It is a simple function that you can execute on one of your DHCP servers and create everything that is needed to support above features.

Script will create:

Option 60 for PXEClient

Option 150 –  that is Cisco option for TFTP server, weird I know, but this is going to make it working in case that you choose UEFI only boot in your BIOS.

It will after create Vendor classes and pack them into conditional policies, so client with specific architecture will get the appropriate parameters.

Function Add-DHCPServerPXEPolicies {
    [CmdletBinding()]
    Param (
    [Parameter(Mandatory=$True)]
    [String]$ComputerName,
    [Parameter(Mandatory=$True)]
    [String]$ScopeID,
    [Parameter(Mandatory=$True)]
    [String]$WDSServer
    )
    Invoke-Command -ComputerName $ComputerName -ScriptBlock {
        # Add DHCP option 60
        netsh dhcp server add optiondef 60 PXEClient STRING 0 comment=”Option added for PXE support”
        # Add DHCP option 150
        netsh dhcp server add optiondef 150 CiscoIPT IPADDRESS 0 comment="TFTP Server for Cisco Call Manager"
        # Restart DHCP Server
        net stop dhcpserver ; net start dhcpserver
        # Define custom Vendor classes
        $UEFI64 = @{
        Name = "PXEClient (UEFI x64)"
        Type = "Vendor"
        Data = "0x505845436c69656e743a417263683a3030303037"
        Description = "PXEClient (UEFI x64)"
        }
        $UEFI86 = @{
        Name = "PXEClient (UEFI x86)"
        Type = "Vendor"
        Data = "0x505845436c69656e743a417263683a3030303036"
        Description = "PXEClient (UEFI x86)"
        }
        $BIOS = @{
        Name = "PXEClient (BIOS x86 & x64)"
        Type = "Vendor"
        Data = "0x505845436c69656e743a417263683a3030303030"
        Description = "PXEClient (BIOS x86 & x64)"
        }
        # Add defined classes into DHCP server
        Add-DhcpServerv4Class @UEFI64
        Add-DhcpServerv4Class @UEFI86
        Add-DhcpServerv4Class @BIOS
        # Create policies for target scope
        Add-DhcpServerv4Policy -Name $UEFI64.Name -ScopeId $($Args[0]) -Condition And -VendorClass EQ,"$($UEFI64.Name)*" -Enabled $True
        Add-DhcpServerv4Policy -Name $UEFI86.Name -ScopeId $($Args[0]) -Condition And -VendorClass EQ,"$($UEFI86.Name)*" -Enabled $True
        Add-DhcpServerv4Policy -Name $BIOS.Name -ScopeId $($Args[0]) -Condition And -VendorClass EQ,"$($BIOS.Name)*" -Enabled $True
        # Add options to previously configured policies
        # UEFI X64
        Set-DhcpServerv4OptionValue -ScopeId $($Args[0]) -PolicyName $UEFI64.Name -OptionId 60 -Value "PXEClient"
        Set-DhcpServerv4OptionValue -ScopeId $($Args[0]) -PolicyName $UEFI64.Name -OptionId 66 -Value $($Args[1])
        Set-DhcpServerv4OptionValue -ScopeId $($Args[0]) -PolicyName $UEFI64.Name -OptionId 67 -value "smsboot\x64\wdsmgfw.efi"
        Set-DhcpServerv4OptionValue -ScopeId $($Args[0]) -PolicyName $UEFI64.Name -OptionId 150 -Value "$($Args[1])"
        # UEFI X86
        Set-DhcpServerv4OptionValue -ScopeId $($Args[0]) -PolicyName $UEFI86.Name -OptionId 60 -Value "PXEClient"
        Set-DhcpServerv4OptionValue -ScopeId $($Args[0]) -PolicyName $UEFI86.Name -OptionId 66 -Value $($Args[1])
        Set-DhcpServerv4OptionValue -ScopeId $($Args[0]) -PolicyName $UEFI86.Name -OptionId 67 -value "smsboot\x86\wdsmgfw.efi"
        Set-DhcpServerv4OptionValue -ScopeId $($Args[0]) -PolicyName $UEFI86.Name -OptionId 150 -Value "$($Args[1])"
        # BIOS
        Set-DhcpServerv4OptionValue -ScopeId $($Args[0]) -PolicyName $BIOS.Name -OptionId 60 -Value "PXEClient"
        Set-DhcpServerv4OptionValue -ScopeId $($Args[0]) -PolicyName $BIOS.Name -OptionId 66 -Value $($Args[1])
        Set-DhcpServerv4OptionValue -ScopeId $($Args[0]) -PolicyName $BIOS.Name -OptionId 67 -value "smsboot\x64\wdsnbp.com"
} -ArgumentList $ScopeID,$WDSServer -ErrorAction SilentlyContinue}