Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9257933
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T12:16:05+00:00 2026-06-18T12:16:05+00:00

In windows I can log in and switch of user without logging out. Like

  • 0

In windows I can log in and switch of user without logging out. Like that I can have multiple users logged in but only one working. How can I know which of the users is currently working.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-18T12:16:06+00:00Added an answer on June 18, 2026 at 12:16 pm

    To my knowledge, the .NET framework does not expose to managed code the API required to achieve this. You will have to p/invoke quite a few WINAPI functions and define at least one structure and some enums on the .NET side.

    If you’re willing to follow that path, you can:

    • Call WTSEnumerateSessions(), passing WTS_CURRENT_SERVER_HANDLE in the hServer argument,

    • Iterate over the returned WTS_SESSION_INFO structures and locate the one whose State member has the WTSActive and WTSConnected bits set (there should only be one in your case),

    • Pass the SessionId member of that structure to WTSQuerySessionInformation(), specifying WTSUserName in the WTSInfoClass argument,

    • Read the user name from the returned buffer,

    • Use WTSFreeMemory() to free the buffer and the array of WTS_SESSION_INFO structures.

    As you can see, this isn’t really trivial. Good luck.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a system service running on my Windows machine that can impersonate the
I'm trying to figure out a way to log off users in local Windows
Are there any tools/libraries on Windows that can help me tarck down the culprit?
What windows C IDE can I use that will use gcc to compile and
i'm working on a windows software which can display all the users, groups and
I know on client side (javascript) you can use windows.location.hash but could not find
Looking for an open source web testing tool that can do Windows Authentication. I've
I am trying to use the .net configuration tool in windows 7 but can
We have a bizarre and very infrequent issue where people can't log off the
I'm implementing a logging solution with Log4Net for a Windows NT Service. I can

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.