Which AD user is logged on a AD computer?

Posted on 2011-03-23
Last Modified: 2012-05-11

I have a Windows 2003 simple Domain -
Is there a query that gives you list of computers, telling which user is logged on each computer?


Question by:lucia570
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
LVL 57

Accepted Solution

Mike Kline earned 250 total points
ID: 35199779
Unfortunately not that I know of.  No attribute in AD that will list what use is logged on a computer.  You could look at a tool from Microsoft called psloggedon

You could also look at using a simple login script like this



Expert Comment

ID: 35199822
Yes. You can query WMI's Win32_ComputerSystem and read "Username". That will give you the currently logged on user.
LVL 57

Expert Comment

by:Mike Kline
ID: 35199865
nice trick, not an AD attribute but going out to the machine itself.

Expert Comment

ID: 35199978
this is a logoff script that one of our Techs found or created it may be helpful. It tells you who the last user was on the computer. It puts the user name in the managed by name field in the computer details in AD. If you have any questions please let me know.
Set objSysInfo = CreateObject("ADSystemInfo") 
Set objComputer = GetObject("LDAP://" & objSysInfo.ComputerName) 
objComputer.Put "managedBy", objSysInfo.Username 

Open in new window


Featured Post

Has Powershell sent you back into the Stone Age?

If managing Active Directory using Windows Powershell® is making you feel like you stepped back in time, you are not alone.  For nearly 20 years, AD admins around the world have used one tool for day-to-day AD management: Hyena. Discover why.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Did you know that more than 4 billion data records have been recorded as lost or stolen since 2013? It was a staggering number brought to our attention during last week’s ManageEngine webinar, where attendees received a comprehensive look at the ma…
Active Directory security has been a hot topic of late, and for good reason. With 90% of the world’s organization using this system to manage access to all parts of their IT infrastructure, knowing how to protect against threats and keep vulnerabil…
This Micro Tutorial hows how you can integrate  Mac OSX to a Windows Active Directory Domain. Apple has made it easy to allow users to bind their macs to a windows domain with relative ease. The following video show how to bind OSX Mavericks to …
Are you ready to implement Active Directory best practices without reading 300+ pages? You're in luck. In this webinar hosted by Skyport Systems, you gain insight into Microsoft's latest comprehensive guide, with tips on the best and easiest way…

730 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question