How to get all logged on user on a machine

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Steven

    How to get all logged on user on a machine

    Hi Gurus,
    Is there any way to find out all the useres currently logged on my machine.
    I am using framework 2.0 with VB.

    I'll appreciate any help I get.
    Thanks, Steven.


  • kimiraikkonen

    #2
    Re: How to get all logged on user on a machine

    On Mar 24, 7:40 pm, "Steven" <Ste...@nospaml .comwrote:
    Hi Gurus,
    Is there any way to find out all the useres currently logged on my machine.
    I am using framework 2.0 with VB.
    >
    I'll appreciate any help I get.
    Thanks, Steven.
    What do you mean by logged on your machine? Logged on your LAN or
    workgroup..?

    Comment

    • Steven

      #3
      Re: How to get all logged on user on a machine

      Workgroups

      Steven

      "kimiraikko nen" <kimiraikkonen8 5@gmail.comwrot e in message
      news:05500ab8-a005-4282-abbf-3b8321ffe445@d4 g2000prg.google groups.com...
      On Mar 24, 7:40 pm, "Steven" <Ste...@nospaml .comwrote:
      >Hi Gurus,
      >Is there any way to find out all the useres currently logged on my
      >machine.
      >I am using framework 2.0 with VB.
      >>
      >I'll appreciate any help I get.
      >Thanks, Steven.
      >
      What do you mean by logged on your machine? Logged on your LAN or
      workgroup..?

      Comment

      • =?Utf-8?B?RmFtaWx5IFRyZWUgTWlrZQ==?=

        #4
        RE: How to get all logged on user on a machine

        Norman Diamond responded with this to a very similar question on the C#
        board. It should apply to VB as well.

        =============== =
        There can be 0 or more current logged in users. If you want all of the 0 or
        1 users who are currently logged in at the console then P/Invoke to
        WTSGetActiveCon soleSessionId and WTSQuerySession Information. If you want
        all of the users then you'll need to call WTSQuerySession Information in a
        loop.

        Warning: Only call the Unicode version of WTSQuerySession Information. If
        your application runs in ANSI then explicitly call the Unicode version
        WTSQuerySession InformationW and convert the result to ANSI by calling
        WideCharToMulti Byte. From C# you mostly don't have to worry about this,
        just make sure that your P/Invoke declaration specifies the Unicode version.
        =============== =

        "Steven" wrote:
        Hi Gurus,
        Is there any way to find out all the useres currently logged on my machine.
        I am using framework 2.0 with VB.
        >
        I'll appreciate any help I get.
        Thanks, Steven.
        >
        >
        >

        Comment

        Working...