Files
2026-06-17 07:17:35 +02:00

34 lines
935 B
PowerShell
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# Detection Script – RustDesk mit korrektem Server konfiguriert
# Gibt nichts aus + ExitCode 0 = installiert/konform
# Gibt Text aus + ExitCode 1 = nicht installiert / falsch konfiguriert
$ExpectedServer = "rd.wende.it"
$ExpectedKey = "aPiGBXPfnyXtDCN8tiut2IziZeadbmocOdJEduzKtoQ"
# Prüfe Exe
$RustDeskExe = "$env:ProgramFiles\RustDesk\rustdesk.exe"
if (-not (Test-Path $RustDeskExe)) {
Write-Output "RustDesk nicht installiert."
exit 1
}
# Prüfe Config (ProgramData)
$TomlPath = "$env:ProgramData\RustDesk\RustDesk2.toml"
if (-not (Test-Path $TomlPath)) {
Write-Output "Konfigurationsdatei fehlt."
exit 1
}
$content = Get-Content $TomlPath -Raw
if ($content -notmatch [regex]::Escape($ExpectedServer)) {
Write-Output "Falscher Server konfiguriert."
exit 1
}
if ($content -notmatch [regex]::Escape($ExpectedKey)) {
Write-Output "Falscher Public Key konfiguriert."
exit 1
}
# Alles OK
exit 0