50 lines
1.8 KiB
PowerShell
50 lines
1.8 KiB
PowerShell
|
|
# Script Simples para Verificar Cliente NoIdle
|
||
|
|
# Execute no PowerShell do DESKTOP-BC16GDH
|
||
|
|
|
||
|
|
Write-Host "Verificando se o cliente NoIdle está rodando..." -ForegroundColor Cyan
|
||
|
|
Write-Host ""
|
||
|
|
|
||
|
|
# Verificar processos
|
||
|
|
$processes = Get-Process | Where-Object {
|
||
|
|
$_.ProcessName -like "*noidle*" -or
|
||
|
|
$_.ProcessName -like "*pointcontrol*" -or
|
||
|
|
$_.MainWindowTitle -like "*NoIdle*" -or
|
||
|
|
$_.MainWindowTitle -like "*PointControl*"
|
||
|
|
}
|
||
|
|
|
||
|
|
if ($processes) {
|
||
|
|
Write-Host "✅ CLIENTE ENCONTRADO!" -ForegroundColor Green
|
||
|
|
$processes | ForEach-Object {
|
||
|
|
Write-Host " Processo: $($_.ProcessName) (PID: $($_.Id))" -ForegroundColor White
|
||
|
|
Write-Host " Caminho: $($_.Path)" -ForegroundColor Gray
|
||
|
|
}
|
||
|
|
} else {
|
||
|
|
Write-Host "❌ CLIENTE NÃO ESTÁ RODANDO" -ForegroundColor Red
|
||
|
|
Write-Host ""
|
||
|
|
Write-Host "Verificando serviços..." -ForegroundColor Yellow
|
||
|
|
$services = Get-Service | Where-Object {
|
||
|
|
$_.DisplayName -like "*NoIdle*" -or
|
||
|
|
$_.DisplayName -like "*PointControl*"
|
||
|
|
}
|
||
|
|
|
||
|
|
if ($services) {
|
||
|
|
Write-Host "✅ Serviço encontrado:" -ForegroundColor Green
|
||
|
|
$services | ForEach-Object {
|
||
|
|
$status = if ($_.Status -eq "Running") { "🟢 Rodando" } else { "🔴 Parado" }
|
||
|
|
Write-Host " $($_.DisplayName) - $status" -ForegroundColor White
|
||
|
|
}
|
||
|
|
} else {
|
||
|
|
Write-Host "❌ Nenhum serviço encontrado" -ForegroundColor Red
|
||
|
|
}
|
||
|
|
}
|
||
|
|
|
||
|
|
Write-Host ""
|
||
|
|
Write-Host "Testando conexão com a API..." -ForegroundColor Cyan
|
||
|
|
try {
|
||
|
|
$response = Invoke-WebRequest -Uri "https://admin.noidle.tech/api/devices/heartbeat" -Method POST -Body '{"device_id":"DEV-1762999424206-0BJR2Q"}' -ContentType "application/json" -TimeoutSec 5
|
||
|
|
Write-Host "✅ API está acessível" -ForegroundColor Green
|
||
|
|
} catch {
|
||
|
|
Write-Host "❌ Não foi possível conectar à API: $_" -ForegroundColor Red
|
||
|
|
}
|
||
|
|
|