Can I determine if a local session is open on a remote computer ?

Posted on 2005-04-13
Last Modified: 2013-11-20
Hello !

I make a connexion to the remote machine registry (RegConnectRegistry) and I check this value :

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon\DefaultUserName

So I can get the last username who logged on the remote computer.

But how can I check if his windows session is open or not ?

I'll hope you can help me ! :-)

thanks (and sorry for my english)
Question by:daneelvosges
    LVL 86

    Accepted Solution

    All you need to do is checking the keys under 'HKEY_USERS'. Apart from that, check out 'PsLoggedOn' (, which comes with full source code:
    LVL 86

    Expert Comment

    BTW, regarding the registry entries - for each user logged on, the system loads the user's profile to that key, just to clarify.

    Author Comment

    It's work !

    Thanks ! :-)

    Featured Post

    What Should I Do With This Threat Intelligence?

    Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

    Join & Write a Comment

    Here is how to use MFC's automatic Radio Button handling in your dialog boxes and forms.  Beginner programmers usually start with a OnClick handler for each radio button and that's just not the right way to go.  MFC has a very cool system for handli…
    Introduction: Database storage, where is the exe actually on the disc? Playing a game selected randomly (how to generate random numbers).  Error trapping with try..catch to help the code run even if something goes wrong. Continuing from the seve…
    This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
    This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor ( If you're looking for how to monitor bandwidth using netflow or packet s…

    746 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

    16 Experts available now in Live!

    Get 1:1 Help Now