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

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)
Who is Participating?
All you need to do is checking the keys under 'HKEY_USERS'. Apart from that, check out 'PsLoggedOn' (, which comes with full source code:
BTW, regarding the registry entries - for each user logged on, the system loads the user's profile to that key, just to clarify.
daneelvosgesAuthor Commented:
It's work !

Thanks ! :-)
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.