• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 734
  • Last Modified:

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
0
lucia570
Asked:
lucia570
  • 2
1 Solution
 
Mike KlineCommented:
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

Featured Post

Prep for the ITIL® Foundation Certification Exam

December’s Course of the Month is now available! Enroll to learn ITIL® Foundation best practices for delivering IT services effectively and efficiently.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now