Created
August 22, 2018 08:08
-
-
Save DXPetti/6f62e7ed9835892fef510f954de69b96 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<# | |
.DESCRIPTION | |
Powershell script to remove DHCP policies that allows Legacy BIOS based network booting (PXE) based upon information sent by client detailed in RFC 4578 (https://tools.ietf.org/html/rfc4578) | |
.PARAMETERS | |
None - execute directly from Powershell | |
.VERSION | |
1.0 | |
.AUTHOR | |
James Pettigrove | |
.COMPATIBILITY | |
Windows 7, Windows 10 | |
.RELEASE DATE | |
06/04/2017 | |
.NOTES | |
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