Hello,
I am using quser to find the idle time of users on a terminal server, I need to filter anyone idled longer than 10 minutes.
With this, use the username to find all processes name PROCESSexample.exe and force close the process. So far I am getting stuck on the system.string with the output not being a int for idle time.
$userName = ‘*’
$computer = ‘localhost’
$quserResult = quser /server:$computer 2>&1
$quserRegex = $quserResult | ForEach-Object -Process { $_ -replace ‘\s{2,}’,‘,’ }
$quserObject = $quserRegex | ConvertFrom-Csv
$Result = $quserobject | where “Idle time” -ge “10”