fix: daily report uses full path to quser.exe when System32 missing from PATH (v1.5.7)

This commit is contained in:
PTah
2026-05-22 10:54:57 +10:00
parent ab98eab49c
commit 16d555037f
2 changed files with 9 additions and 3 deletions
+8 -2
View File
@@ -71,7 +71,7 @@ $script:MonitorSingletonLockStream = $null
# строки ниже, если правки «мелкие» и вы не хотите менять отображаемую версию в логах).
# Рекомендация: при значимых релизах меняйте и $ScriptVersion, и version.txt одинаково; при только
# исправлениях на шаре — достаточно поднять patch в version.txt (например 1.3.0.1).
$ScriptVersion = "1.5.6"
$ScriptVersion = "1.5.7"
# Логи (все под InstallRoot)
$LogFile = Join-Path $script:InstallRoot "Logs\login_monitor.log"
@@ -1873,7 +1873,13 @@ function Format-RDGatewayEvent {
function Send-DailyReport {
try {
$quserOutput = @(& quser 2>$null)
$quserExe = Join-Path $env:SystemRoot 'System32\quser.exe'
$quserOutput = if (Test-Path -LiteralPath $quserExe) {
@(& $quserExe 2>$null)
} else {
Write-Log "quser.exe not found: $quserExe"
@()
}
$usernames = [System.Collections.Generic.List[string]]::new()
if ($quserOutput -and $quserOutput.Count -gt 1) {
$sessionLines = @($quserOutput | Select-Object -Skip 1)
+1 -1
View File
@@ -1 +1 @@
1.5.6
1.5.7