Pstools psloggedon

It is becoming increasingly common that a user will not log off but will simply disappear and lock the computer.
I need to expand what psloggedon does to include whether they are in locked mode or unlocked mode and as of when that occurred.  Assistance is greatly appreciated.
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Davis McCarnOwnerCommented:
If they are connecting using RDP or RDS, what you want shows in the Remote Desktop Services Manager which is in Administrative Tools.
Qlemo"Batchelor", Developer and EE Topic AdvisorCommented:
Enable auditing of the corresponding events, then you will have event ID 4800 in Security Event Log for locking (see for the event IDs related to login, or for all of the security related ones).

Auditing can be set up starting Local Security Policy resp. Local Security Settings (both secpol.msc), and then set Local Policies » Audit Policy.
Or using Group Policies (gpedit.msc), Computer Configuration » Windows Settings » Security Settings » Advanced Audit Policy Configuration » System Audit Policies - Local Group Policy Object » Logon/Logoff » Audit Other Login/Logoff Events.

After having done that, you'll need to check for the last event 4800. Of course you can only find info starting at the time you enabled auditing. How you do that is a matter of taste and allowed resources. PowerShell's Get-WinEvent is great for this purpose.
Qlemo"Batchelor", Developer and EE Topic AdvisorCommented:
Another approach is to force logoff after being idle for x minutes. Drastic, but they are getting the message sooner or later ;-).

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Windows 7

From novice to tech pro — start learning today.