Which AD user is logged on a AD computer?

Hello,

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?

Thanks!

Lucia
lucia570Asked:
Who is Participating?
 
Mike KlineConnect With a Mentor Commented:
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  http://technet.microsoft.com/en-us/sysinternals/bb897545

You could also look at using a simple login script like this  http://msmvps.com/blogs/kwsupport/archive/2005/02/24/36942.aspx

Thanks

Mike
0
 
drilusCommented:
Yes. You can query WMI's Win32_ComputerSystem and read "Username". That will give you the currently logged on user.
0
 
Mike KlineCommented:
nice trick, not an AD attribute but going out to the machine itself.
0
 
chris_martin62Commented:
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 
objComputer.SetInfo

Open in new window

0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.