Skip to content

Commit 6e94859

Browse files
committed
Remove overkill server validation
1 parent 061527f commit 6e94859

File tree

1 file changed

+0
-15
lines changed

1 file changed

+0
-15
lines changed

DDI/Get-DhcpOptionUsed.ps1

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -42,21 +42,6 @@
4242
} # end begin block
4343

4444
process {
45-
# Check if the $Server is listed in the objects returned by Get-DhcpServerInDC.
46-
$DhcpServers = Get-DhcpServerInDC
47-
if ($DhcpServers.DnsName -notmatch $Server) {
48-
Write-Warning -Message "The server `'$Server`' is not an authorized DHCP server in the domain."
49-
return
50-
}
51-
52-
# Verify that the server is reachable.
53-
try {
54-
$null = Test-NetConnection -ComputerName $Server -Count 1 -ErrorAction Stop
55-
} catch {
56-
Write-Error "Unable to connect to server: $Server"
57-
return
58-
}
59-
6045
# Get all IPv4 DHCP server options and check the options set on each.
6146
Write-Host 'Checking DHCP Server Options....' -ForegroundColor Green -BackgroundColor Black
6247
$ServerOptions = Get-DhcpServerv4OptionValue

0 commit comments

Comments
 (0)