Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Powershell script to remove DHCP policies that allows Legacy BIOS based network booting (PXE) based upon information sent by client detailed in RFC 4578 (
None - execute directly from Powershell
James Pettigrove
Windows 7, Windows 10
v1.0, 20170401 - Initial Version
$dhcpServers = Get-DhcpServerInDC
$className = "PXEClient(Legacy BIOS)"
$policyName = "Legacy BIOS"
[array]$dhcpScopes = (Read-Host "Enter DHCP Scopes (separate with comma) to remove Legacy BIOS boot option").split(",") | %{$_.trim()}
foreach ($dhcpServer in $dhcpServers) {
foreach ($dhcpScope in $dhcpScopes) {
Write-Host -ForegroundColor Yellow "Removing $policyName from $dhcpScope"
Remove-DhcpServerv4Policy -ComputerName $dhcpServer -ScopeId $dhcpScope -Name $policyName
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment