Solved

Which AD user is logged on a AD computer?

Posted on 2011-03-23
4
721 Views
Last Modified: 2012-05-11
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
Comment
Question by:lucia570
  • 2
4 Comments
 
LVL 57

Accepted Solution

by:
Mike Kline earned 250 total points
Comment Utility
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
 
LVL 5

Expert Comment

by:drilus
Comment Utility
Yes. You can query WMI's Win32_ComputerSystem and read "Username". That will give you the currently logged on user.
0
 
LVL 57

Expert Comment

by:Mike Kline
Comment Utility
nice trick, not an AD attribute but going out to the machine itself.
0
 
LVL 7

Expert Comment

by:chris_martin62
Comment Utility
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

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

Disabling the Directory Sync Service Account in Office 365 will stop directory synchronization from working.
ADCs have gained traction within the last decade, largely due to increased demand for legacy load balancing appliances to handle more advanced application delivery requirements and improve application performance.
This tutorial will walk an individual through the process of transferring the five major, necessary Active Directory Roles, commonly referred to as the FSMO roles from a Windows Server 2008 domain controller to a Windows Server 2012 domain controlle…
This tutorial will walk an individual through the process of configuring their Windows Server 2012 domain controller to synchronize its time with a trusted, external resource. Use Google, Bing, or other preferred search engine to locate trusted NTP …

771 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now