Skip to content

Commit eaf7f1b

Browse files
committed
Add KMS Support and some additional Ports
1 parent 38d5f6d commit eaf7f1b

File tree

1 file changed

+22
-11
lines changed

1 file changed

+22
-11
lines changed

Network/Check-Network.ps1

+22-11
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141
#>
4242

4343
param (
44-
[int]$targetMTU = 8000,
44+
[int]$targetMTU = 1500,
4545
[int]$mtuoh = 28,
4646
[string]$DNSDomain = (Get-DnsClientGlobalSetting).SuffixSearchList[0],
4747
[string]$logpath = "C:\Windows\System32\LogFiles"
@@ -214,17 +214,19 @@ ForEach ($DC in $DCs2)
214214
Write-Output "============================================"
215215
Write-Output "WinRM (TCP 5985) : $((Test-NetConnection -ComputerName $DC -CommonTCPPort WINRM -ErrorAction SilentlyContinue -WarningAction SilentlyContinue ).TcpTestSucceeded)"
216216
Write-Output "WinRMs (TCP 5986) : $((Test-NetConnection -ComputerName $DC -Port 5986 -ErrorAction SilentlyContinue -WarningAction SilentlyContinue ).TcpTestSucceeded)"
217-
Write-Output "Kerberos (TCP 88) : $((Test-NetConnection -ComputerName $DC -Port 88 -ErrorAction SilentlyContinue -WarningAction SilentlyContinue ).TcpTestSucceeded)"
218-
Write-Output "KerberosPW (TCP 464) : $((Test-NetConnection -ComputerName $DC -Port 464 -ErrorAction SilentlyContinue -WarningAction SilentlyContinue ).TcpTestSucceeded)"
219-
Write-Output "DNS (TCP 53) : $((Test-NetConnection -ComputerName $DC -Port 53 -ErrorAction SilentlyContinue -WarningAction SilentlyContinue ).TcpTestSucceeded)"
220-
Write-Output "RPC (TCP 135) : $((Test-NetConnection -ComputerName $DC -Port 135 -ErrorAction SilentlyContinue -WarningAction SilentlyContinue ).TcpTestSucceeded)"
221-
Write-Output "SMB (TCP 445) : $((Test-NetConnection -ComputerName $DC -Port 445 -ErrorAction SilentlyContinue -WarningAction SilentlyContinue ).TcpTestSucceeded)"
222-
Write-Output "Legacy NetBios (TCP 139) : $((Test-NetConnection -ComputerName $DC -Port 445 -ErrorAction SilentlyContinue -WarningAction SilentlyContinue ).TcpTestSucceeded)"
217+
Write-Output "Kerberos (TCP 88) : $((Test-NetConnection -ComputerName $DC -Port 88 -ErrorAction SilentlyContinue -WarningAction SilentlyContinue ).TcpTestSucceeded)"
218+
Write-Output "KerberosPW (TCP 464) : $((Test-NetConnection -ComputerName $DC -Port 464 -ErrorAction SilentlyContinue -WarningAction SilentlyContinue ).TcpTestSucceeded)"
219+
Write-Output "ADWS (TCP 9389) : $((Test-NetConnection -ComputerName $DC -Port 9389 -ErrorAction SilentlyContinue -WarningAction SilentlyContinue ).TcpTestSucceeded)"
220+
Write-Output "DNS (TCP 53) : $((Test-NetConnection -ComputerName $DC -Port 53 -ErrorAction SilentlyContinue -WarningAction SilentlyContinue ).TcpTestSucceeded)"
221+
Write-Output "RPC (TCP 135) : $((Test-NetConnection -ComputerName $DC -Port 135 -ErrorAction SilentlyContinue -WarningAction SilentlyContinue ).TcpTestSucceeded)"
222+
Write-Output "SMB (TCP 445) : $((Test-NetConnection -ComputerName $DC -Port 445 -ErrorAction SilentlyContinue -WarningAction SilentlyContinue ).TcpTestSucceeded)"
223+
Write-Output "Legacy NetBios (TCP 139) : $((Test-NetConnection -ComputerName $DC -Port 139 -ErrorAction SilentlyContinue -WarningAction SilentlyContinue ).TcpTestSucceeded)"
223224
Write-Output " "
224225
Write-Output "Test Common UDP ports connection (True might be filltered / silently droped!)"
225226
Write-Output "============================================"
226227
Write-Output "Kerberos (UDP 88) : $(Test-UDP -target $DC -UDPport 88 )"
227-
Write-Output "DNS (UDP 53) : $(Test-UDP -target $DC -UDPport 53 )"
228+
Write-Output "KerberosPW (UDP 464) : $(Test-UDP -target $DC -UDPport 464 )"
229+
Write-Output "DNS (UDP 53) : $(Test-UDP -target $DC -UDPport 53 )"
228230
Write-Output "SMB (UDP 445) : $(Test-UDP -target $DC -UDPport 445 )"
229231
Write-Output "W32Time / NTP (UDP 123) : $(Test-UDP -target $DC -UDPport 123 )"
230232
Write-Output "Legacy NetBios (UDP 137) : $(Test-UDP -target $DC -UDPport 137 )"
@@ -238,8 +240,17 @@ ForEach ($DC in $DCs2)
238240
Write-Output " "
239241
Write-Output "Test SMB connection (might not work for not Domainjoined Computers)"
240242
Write-Output "============================================"
241-
Write-Output "Found Directories in SysVol: $(([System.IO.Directory]::GetDirectories($("\\"+$DC+"\SysVol"))).Count)"
242-
Write-Output "Found Files in NetLogon: $(([System.IO.Directory]::GetFiles($("\\"+$DC+"\NetLogon"))).Count)"
243-
243+
Get-ChildItem \\$DC\Sysvol\$env:USERDNSDOMAIN
244+
Get-ChildItem \\$DC\NetLogon
244245
}
246+
247+
# Abfrage der SRV-Einträge für den KMS-Server
248+
$kmsInfo = nslookup -type=srv _vlmcs._tcp | Select-String -Pattern "port|svr hostname"
249+
IF ( $kmsInfo.count -gt 0)
250+
{
251+
$kmsport = ($kmsInfo | Select-String -Pattern "port" | ForEach-Object { $_.Line.Split("=").Trim() })
252+
$kmsserver = ($kmsInfo | Select-String -Pattern "svr hostname" | ForEach-Object { $_.Line.Split("=").Trim() })
253+
Write-Output "Found Microsoft Key Management server $kmsserver port $kmsport"
254+
Write-Output "MS KMS Server (TCP $kmsport) : $((Test-NetConnection -ComputerName $kmsserver -Port $kmsserver -ErrorAction SilentlyContinue -WarningAction SilentlyContinue ).TcpTestSucceeded)"
255+
} Else { Write-Output "No MS KMS Server found"}
245256
Stop-Transcript

0 commit comments

Comments
 (0)