
nl and thought I would expand on this in my own way to Retrieves all user sessions from local or remote computer(s).

Simply open the PowerShell and execute the following two lines of code: The first line You can use this configure what time do you want it checks idle time, example if you want starts at 8am, use value 480, calculate 8 time 60 minutes, so it’s 480.# restriction but want to lock your screen after a idle timeout.

# press + everytime you leave your desk ). From an ssh session: export DISPLAY=:0 & sudo -u john xprintidle. There are quite a few ways to check when a certain machine was turned on. This process becomes quite complicated and time-consuming when you have to the track logon session time for multiple users. Thank you very much for the help.Powershell get user idle time If the idle time is more than 14 minutes, then the powershell script kicks off the shutdown tool. Powershell Param ( $action ) $Today = Get-date -Format "dd_MMM_yy" $LoggedInUser = $env:USERNAME Import-Module ActiveDirectory Import-Csv "C:\Users\jim.leonard\Desktop\Scripts\allinone\DisableUsers.csv" | ForEach -Object and it works now.
