$computers = @( "192.168.100.97", "192.168.100.3" ) foreach ($computer in $computers) { Write-Host "================================" -ForegroundColor Cyan Write-Host "Comprobando: $computer" # Ping (Usando -Count y -ErrorAction para evitar basura en pantalla) if (Test-Connection -ComputerName $computer -Count 1 -Quiet) { Write-Host "Ping: OK" -ForegroundColor Green } else { Write-Host "Ping: FALLA" -ForegroundColor Red } # Prueba de Puertos (SMB y NetBIOS) $ports = @(445, 139, 137) foreach ($port in $ports) { $check = Test-NetConnection -ComputerName $computer -Port $port -WarningAction SilentlyContinue if ($check.TcpTestSucceeded) { Write-Host "Puerto $port: OK" -ForegroundColor Green } else { Write-Host "Puerto $port: FALLA" -ForegroundColor Red } } Write-Host "NBSTAT:" nbtstat.exe -A $computer Write-Host "" }