Files
claudetools/clients/dataforth/scripts/test-ssh-after-key.ps1
Mike Swanson 5cbd49ce24 Reorganize repo: compartmentalize scripts by client/project
Move 150+ scripts from root and scripts/ into client/project directories:
- clients/dataforth/scripts/ (110 files: AD2, sync, SSH, DB, DOS scripts)
- clients/bg-builders/scripts/ (14 files: Lesley mgmt, Exchange, termination)
- clients/internal-infrastructure/scripts/ (10 files: GDAP, Gitea, backups)
- projects/msp-tools/scripts/ (9 files: CIPP, MSP onboarding, Datto)
- projects/gururmm-agent/scripts/ (3 files: API test, JWT, record counts)
- clients/glaztech/scripts/ (1 file: CentraStage removal)

Also reorganized:
- VPN scripts → infrastructure/vpn-configs/
- Retrieved API/JS files → api/
- Forum posts → projects/community-forum/forum-posts/
- SSH docs → clients/internal-infrastructure/docs/
- NWTOC/CTONW docs → projects/wrightstown-smarthome/docs/
- ACG website files → projects/internal/acg-website-2025/
- Dataforth docs → clients/dataforth/docs/
- schema-retrieved.sql → docs/database/

Deleted 24 tmp_*.ps1 one-off debug scripts (preserved in git history).
Root reduced from 220+ files to 62 items (docs + directories only).

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-20 17:15:07 -07:00

33 lines
1.5 KiB
PowerShell

$password = ConvertTo-SecureString 'Paper123!@#' -AsPlainText -Force
$cred = New-Object System.Management.Automation.PSCredential('INTRANET\sysadmin', $password)
Write-Host "Testing SSH After Adding Key..." -ForegroundColor Cyan
Write-Host ""
Invoke-Command -ComputerName 192.168.0.6 -Credential $cred -ScriptBlock {
Write-Host "[1] Testing SSH as sysadmin user..." -ForegroundColor Yellow
$result = & ssh -o ConnectTimeout=5 -o StrictHostKeyChecking=no root@192.168.0.9 "hostname" 2>&1
if ($LASTEXITCODE -eq 0) {
Write-Host " [SUCCESS] SSH works! Result: $result" -ForegroundColor Green
} else {
Write-Host " [FAILED] SSH failed: $result" -ForegroundColor Red
Write-Host " Exit code: $LASTEXITCODE" -ForegroundColor Red
}
Write-Host ""
Write-Host "[2] Testing find command..." -ForegroundColor Yellow
$findResult = & ssh -o ConnectTimeout=10 -o StrictHostKeyChecking=no root@192.168.0.9 "find /data/test/TS-4R/LOGS -name '*.DAT' -type f -mmin -1440 2>/dev/null | wc -l" 2>&1
if ($LASTEXITCODE -eq 0) {
Write-Host " [SUCCESS] Find command works! Found: $findResult DAT files" -ForegroundColor Green
} else {
Write-Host " [FAILED] Find failed: $findResult" -ForegroundColor Red
}
Write-Host ""
Write-Host "[3] Manually running sync script..." -ForegroundColor Yellow
& powershell.exe -ExecutionPolicy Bypass -File "C:\Shares\test\scripts\Sync-FromNAS.ps1"
}
Write-Host ""
Write-Host "Test complete!" -ForegroundColor Cyan