Active Directory Users and Computers

Posted on 2009-12-22
Last Modified: 2012-08-14
From Active directory Users and Computers, can I find for a specific computer the user who is currently logged in that computer? and also, can I find the users that used the computer so far, from the time the computer was added in the domain?
Question by:Harrris
    LVL 57

    Expert Comment

    by:Mike Kline
    You can't do those things from AD users and computers.
    For the currently logged in question you can use pslogged on from MIcrosoft
    As far as finding every user that has logged on from a particular computer that would take going through security logs (local or search through all the DCs).   that may not be easy though as logs are overwritten (depending on your settings).

    Author Comment

    Actually this is what I want to do:
    I have an IP address of a computer and I want to know who is currently using that IP. From AD users and computers you can create a query and find the computer which has that IP address, but you cannot find the user who owns/uses that PC (only if the hostname of the PC is something that refers to the user). I know that in AD, a computer and its user are two different objects but are computer objects and user objects related in any way that helps you to find who is the user of a specific computer?
    LVL 57

    Expert Comment

    by:Mike Kline
    No unfortunately there is no association between a user and computer object in AD.  In this case I'd go to the local logs on that PC.
    LVL 24

    Accepted Solution

    If you want who is logged into which computer,first you have to enable directory audit loging.
    echo logon %username% %computername% %date% %time% >> \\FILE_LOCATION.txt  

    You can download it here:

    You can view a document about it and how to customise it for your set up here:
    LVL 7

    Assisted Solution

    Hello Harris,

    About your question about how to find who all users have logged on to that machine, you can remotely access this registry location of that client machine:

    HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProfileList

    This location contains the SIDs of the users who have logged on to that machine and their profile information.
    On the right, you will find the string value called ProfileImagePath and that should tell you which user's SID that is.  
    Event if you have roaming profiles, this location will contain the SIDs.

    For more details about profile structure refer this:


    LVL 1

    Assisted Solution

    From the Domain Controller, right click my computer and select manage, double click sessions and from there you can see who is logged in using what Ip and you can arrange the collumsn by IP if you would like.

    BTW you can get a computer name from a IP by  ping -a
    LVL 4

    Expert Comment


    The free tool Limitlogin.exe from Microsoft can be used to see user's login information and that may be what you want:

    Download it here:

    Hope this helps.
    LVL 2

    Assisted Solution


    PsLoggedOn is an useful sysinternal tool for displays both the locally logged on users and users logged on via resources for either the local computer, or a remote one.

    Featured Post

    How to improve team productivity

    Quip adds documents, spreadsheets, and tasklists to your Slack experience
    - Elevate ideas to Quip docs
    - Share Quip docs in Slack
    - Get notified of changes to your docs
    - Available on iOS/Android/Desktop/Web
    - Online/Offline

    Join & Write a Comment

    Welcome to my series of short tips on migrations. Whilst based on Microsoft migrations the same principles can be applied to any type of migration. My first tip is around source server preparation. No migration is an easy migration, there is a…
    Mapping Drives using Group policy preferences Are you still using old scripts to map your network drives if so this article will show you how to get away for old scripts and move toward Group Policy Preference for mapping them. First things f…
    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 transferring the five major, necessary Active Directory Roles, commonly referred to as the FSMO roles to another domain controller. Log onto the new domain controller with a user account t…

    732 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

    18 Experts available now in Live!

    Get 1:1 Help Now