When you still have devices in your environment which are only supporting legacy PXE boots and you also want to support UEFI PXE boots with the same task sequence this blog-post is meant for you. I will also give you some additional options you can add to your partitioning step in the Task Sequence (TS) which could come in handy.
Although I recommend using IP helpers above using DHCP, because IP Helpers are much more reliable, underneath a step-by-step guide to configure DHCP for PXE booting legacy and UEFI in your network.
Configure DHCP to support both legacy and UEFI mode
Step one: Create custom vendor classes to use with your DHCP Policy
Create custom Vendor Classes as described in the following steps, these will help to determine how the devices are requesting the boot image from the DHCP server.- Open the DHCP Console and expand the IPv4 Node
- Right-Click on ‘IPv4 Node’ and select ‘Define Vendor Classes’
- Click ‘Add’
- Enter the following information:
- DisplayName: PXEClient (UEFI x64)
- Description: PXEClient:Arch:00007
- ASCII: PXEClient:Arch:00007
- Click ‘OK’
- Click ‘Add’
- Enter the following information
- DisplayName: PXEClient (UEFI x86)
- Description: PXEClient:Arch:00006
- ASCII: PXEClient:Arch:00006
- Click ‘OK’
- Click ‘Add’
- Enter the following information
- DisplayName: PXEClient (BIOS x86 & x64)
- Description: PXEClient:Arch:00000
- ASCII: PXEClient:Arch:00000
- Click ‘OK’
Step two: Create the custom DHCP Policies
UEFI x86 DHCP Policy- Right-Click ‘Policies’ and click ‘New Policy’
- Enter the following information:
- PolicyName: PXEClient (UEFI x86)
- Description: Bootfile for UEFI x86 devices
- Click ‘Next’
- On the ‘Configure Conditions for the policy’ page click ‘add’
- Select the ‘Value’ drop-down box, select the ‘PXEClient (UEFI x86)’ vendor class which we created in the previous steps
- be sure to check the box ‘Append wildcard(*)’
- Select ‘Add’
- Select ‘Ok’
- Click ‘Next’
- Configure the scope if you want to target the policy on a specific IP range or select ‘No’ and click ‘Next’
- Be sure that on the Configure settings for the policy page that ‘DHCP Standard Options’ is selected.
- Configure the following scope options:
- Option 060: PXEClient
- Option 066: IP Address of the SCCM or WDS Service
- Option 067: smsbootx86wdsmgfw.efi
- Cick ‘Next’
- Click ‘Finish’
UEFI x64 DHCP Policy
- Right-Click ‘Policies’ and click ‘New Policy’
- Enter the following information:
- PolicyName: PXEClient (UEFI x64)
- Description: Bootfile for UEFI x64 devices
- Click ‘Next’
- On the ‘Configure Conditions for the policy’ page click ‘add’
- Select the ‘Value’ drop-down box, select the ‘PXEClient (UEFI x64)’ vendor class which we created in the previous steps
- be sure to check the box ‘Append wildcard(*)’
- Select ‘Add’
- Select ‘Ok’
- Click ‘Next’
- Configure the scope if you want to target the policy on a specific IP range or select ‘No’ and click ‘Next’
- Be sure that on the Configure settings for the policy page that ‘DHCP Standard Options’ is selected.
- Configure the following scope options:
- Option 060: PXEClient
- Option 066: IP Address of the SCCM or WDS Service
- Option 067: smsbootx64wdsmgfw.efi
- Cick ‘Next’
- Click ‘Finish’
(Legacy) BIOS x86 & x64 DHCP Policy
- Right-Click ‘Policies’ and click ‘New Policy’
- Enter the following information:
- PolicyName: PXEClient (BIOS x86 & x64)
- Description: Bootfile for BIOS devices
- Click ‘Next’
- On the ‘Configure Conditions for the policy’ page click ‘add’
- Select the ‘Value’ drop-down box, select the ‘PXEClient (BIOS x86 & x64)’ vendor class which we created in the previous steps
- be sure to check the box ‘Append wildcard(*)’
- Select ‘Add’
- Select ‘Ok’
- Click ‘Next’
- Configure the scope if you want to target the policy on a specific IP range or select ‘No’ and click ‘Next’
- Be sure that on the Configure settings for the policy page that ‘DHCP Standard Options’ is selected.
- Configure the following scope options:
- Option 060: PXEClient
- Option 066: IP Address of the SCCM or WDS Service
- Option 067: smsbootx64wdsnbp.com
- Cick ‘Next’
- Click ‘Finish’
Final step:
Remove all the default scope options 066, 067, 060Configure the task sequence to support both legacy and UEFI mode
Legacy and UEFI need to have a different disk partitioning configuration. During the partitioning steps we can detect if the device was legacy or UEFI PXE booted. By adding the following task sequence variable into your partitioning step you can determine if your device was booted in legacy or UEFI mode. To check if the device is PXE booted in UEFI mode add the following TS variable:_SMSTSBootUEFI equels "True"Your UEFI partitioning step could look like this:
Or to check whether the device is PXE booted in legacy mode:
_SMSTSBootUEFI not equals "True"Your legacy partitioning step could look like this:
This way you can determine the disk partition configuration depending on the PXE mode (legacy/UEFI). Depending on your environment you can also create different partitioning steps within your TS for desktops, laptops, tablets or depending on your disk size. If you would like to create a second disk partition, for example when the disk is greater in size than 128gb, you can use the following WMI query:
SELECT * FROM Win32_DiskDrive WHERE Index = "0" AND Size > 138438953472And change ‘>’ to ‘<‘ to detect if the disk is smaller and you only want one partition.
If you have any comments or questions about this blog post please post them below in the comment section and I will try to answer them as soon as possible.
I’ve been using the DHCP referrals for a while. Though not that difficult to set up, it involves lots of clicking things and is prone to typo’s. So i’ve simplified it a bit:
[CmdletBinding()]
param (
[Parameter(HelpMessage=’The PXE Server hostname or IP Address.’)]
[string]$PXEServer = ‘yourserver.yourdomain.local’,
[Parameter(HelpMessage=’ScopeID in IPv4 format. Use 0 for Server scope.’)]
[string]$ScopeID = 0
)
if ($VerbosePreference -eq ‘Continue’)
{
$PSDefaultParameterValues[‘*:Verbose’] = $true
}
$x86 = @{
VendorClassName = ‘PXEClient (BIOS x86 & x64)’
VendorClassDescription = ‘PXEClient:Arch:00000’
VendorClassType = ‘Vendor’
VendorClassData = ‘PXEClient:Arch:00000’
PolicyName = ‘PXE Boot Legacy BIOS’
NBP = ‘smsboot\x64\wdsnbp.com’
}
$x64 = @{
VendorClassName = ‘PXEClient (UEFI x64)’
VendorClassDescription = ‘PXEClient:Arch:00007’
VendorClassType = ‘Vendor’
VendorClassData = ‘PXEClient:Arch:00007’
PolicyName = ‘PXE Boot UEFI x64’
NBP = ‘smsboot\x64\wdsmgfw.efi’
}
# Create the Vendor Classes:
Write-output ‘Creating Vendor Classes.’
Add-DhcpServerv4Class -Name $x86.VendorClassName -Description $x86.VendorClassDescription -Type $x86.VendorClassType -Data $x86.VendorClassData
Add-DhcpServerv4Class -Name $x64.VendorClassName -Description $x64.VendorClassDescription -Type $x64.VendorClassType -Data $x64.VendorClassData
# Create the Policies:
Write-Output ‘Creating Policies.’
Add-DhcpServerv4Policy -Name $x86.PolicyName -ScopeId $ScopeID -Condition OR -VendorClass EQ,”$($x86.VendorClassName)*”
Set-DhcpServerv4OptionValue -PolicyName $x86.PolicyName -OptionId 066 -Value $PXEServer
Set-DhcpServerv4OptionValue -PolicyName $x86.PolicyName -OptionId 067 -Value $x86.NBP
Add-DhcpServerv4Policy -Name $x64.PolicyName -ScopeId $ScopeID -Condition OR -VendorClass EQ,”$($x64.VendorClassName)*”
Set-DhcpServerv4OptionValue -PolicyName $x64.PolicyName -OptionId 066 -Value $PXEServer
Set-DhcpServerv4OptionValue -PolicyName $x64.PolicyName -OptionId 067 -Value $x64.NBP
Write-Output ‘Done.’