Retrieve the KMS Host Name First, open PowerShell with administrative rights. Then, use the following command to retrieve the KMS host name:
1 2 | $kmsHost = ( Get-WmiObject -query "select * from SoftwareLicensingService" ).KeyManagementServiceMachine Write-Output "KMS Host: $kmsHost" |
Verify the KMS Host To ensure that the KMS host is actively communicating within your network, perform the following checks:
- Ping Test: Verify if the server is reachable
1 2 3 4 5 | if ( Test-Connection -ComputerName $kmsHost -Count 2 -Quiet ) { Write-Output "Ping to $kmsHost successful." } else { Write-Output "Failed to ping $kmsHost." } |
Port Check: Confirm that the necessary port for KMS (TCP 1688) is open.
1 2 3 4 5 6 7 8 9 10 11 | $port = 1688 $tcpTest = New-Object System.Net.Sockets.TcpClient try { $tcpTest .Connect( $kmsHost , $port ) if ( $tcpTest .Connected) { Write-Output "Port $port on $kmsHost is open." } $tcpTest .Close() } catch { Write-Output "Port $port on $kmsHost is not open." } |
0 Comments