diff --git a/activitystats.ps1 b/activitystats.ps1 old mode 100644 new mode 100755 index 90909a5..d077aea --- a/activitystats.ps1 +++ b/activitystats.ps1 @@ -47,9 +47,9 @@ $windowsEdition = (Get-CimInstance Win32_OperatingSystem).Caption $idleTime = [UserInput]::GetIdleTime() if ($idleTime.TotalMinutes -gt 15) { $lastActive = (Get-Date).add(-$idleTime) - Write-Host "($username) is logged in via Console and inactive since $lastActive." + Write-Host "($username) [console] logged in and inactive since $lastActive." } else { - Write-Host "($username) is currently logged in via Console and active." + Write-Host "($username) [console] is logged in and active." } } elseif ($rdpSession) { $username = ($rdpSession -split "\s+")[2] @@ -57,9 +57,9 @@ $windowsEdition = (Get-CimInstance Win32_OperatingSystem).Caption $idleTime = [UserInput]::GetIdleTime() if ($idleTime.TotalMinutes -gt 15) { $lastActive = (Get-Date).add(-$idleTime) - Write-Host "($username) is logged in via RDP and inactive since $lastActive." + Write-Host "($username) [mstsc] logged in and inactive since $lastActive." } else { - Write-Host "($username) is currently logged in via RDP and active." + Write-Host "($username) [mstsc] currently logged in and active." } } @@ -77,9 +77,9 @@ $windowsEdition = (Get-CimInstance Win32_OperatingSystem).Caption $idleTime = [UserInput]::GetIdleTime() if ($idleTime.TotalMinutes -gt 15) { $lastActive = (Get-Date).add(-$idleTime) - Write-Host "($username) is logged in and inactive since $lastActive" + Write-Host "($username) [console] logged in and inactive since $lastActive" } else { - Write-Host "($username) is currently logged on and active." + Write-Host "($username) [console] currently logged on and active." } } else { Write-Host "No user is currently logged on."