Posts

How to use PowerShell to find what computer a user is CURRENTLY logged into.

I recently had an issue where I needed the ability to identify the PC(s) where a user was logged into.  I found part of the answer here:  http://deployhappiness.com/find-out-what-computer-a-user-logged-into/#comment-5068 I won't reprint it here but the jist is by using a logon/logoff VB script, and a GPO, you can populate a field in the Active Directory record of each PC in a domain. That part works really well.  After that you would need to search AD for the username to identify the PC. What I've done is created a PowerShell script with a GUI to do it for you.  Now, it's not finished yet, but it does work.  The code below is dirty and as soon as I get it the way I want I'll update this posting, but for now, it works pretty well.  Don't complain about bugs,I know it has them, I'm working on it.  And, yes, I have no doubt some things could be done better or more efficiently, feel free to post improvements. What it has (or will have): Self re...