Skip to content

Commit

Permalink
Fix KMS Hostname
Browse files Browse the repository at this point in the history
  • Loading branch information
FabianNiesen committed Sep 30, 2024
1 parent 8768f44 commit 29ab056
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Network/Check-Network.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -250,12 +250,12 @@ $kmsInfo = nslookup -type=srv _vlmcs._tcp | Select-String -Pattern "port|svr hos
IF ( $kmsInfo.count -gt 0)
{
[int]$kmsport = (($kmsInfo | Select-String -Pattern "port" ) -split("="))[1].trim()
$kmsserver = ($kmsInfo | Select-String -Pattern "svr hostname" | ForEach-Object { $_.Line.Split("=").Trim() }| Out-String)
$kmsserver = (($kmsInfo | Select-String -Pattern "svr hostname") -split("="))[1].trim()
Write-Output " "
Write-Output "Found Microsoft Key Management server $kmsserver port $kmsport"
Write-Output "============================================"
Write-Output "MS KMS Server (TCP $kmsport) : $((Test-NetConnection -ComputerName $kmsserver -Port $kmsport -ErrorAction SilentlyContinue -WarningAction SilentlyContinue ).TcpTestSucceeded)"
Write-Output " "
csript.exe c:\windows\system32\slmgr.vbs -dli
c:\windows\system32\cscript.exe c:\windows\system32\slmgr.vbs -dli
} Else { Write-Output "No MS KMS Server found"}
Stop-Transcript

0 comments on commit 29ab056

Please sign in to comment.