CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    Feb 2000
    Location
    OH - USA
    Posts
    1,892

    Who Is Logged In?

    I need a way to determine what group the logged in user belongs to on Win2k. For instance: Administrator's, Power User's, User's...etc. Thanks in advance for any ideas!!

    Good Luck,
    Craig - CRG IT Solutions - Microsoft Gold Partner

    -My posts after 08/2015 = .NET 4.x and Visual Studio 2015
    -My posts after 11/2011 = .NET 4.x and Visual Studio 2012
    -My posts after 02/2010 = .NET 4.0 and Visual Studio 2010
    -My posts after 12/2007 = .NET 3.5 and Visual Studio 2008
    -My posts after 04/2007 = .NET 3.0 and Visual Studio 2005
    -My posts before 04/2007 = .NET 1.1/2.0

    *I do not follow all threads, so if you have a secondary question, message me.

  2. #2
    Join Date
    Aug 2001
    Location
    Madrid
    Posts
    3

    Re: Who Is Logged In?

    You can combines NetWkstaGetInfo (top three list items) and NetWkstaUserEnum (bottom three) to retrieve the domain (or workgroup) for a specified machine, along with the user name, server and domain in which the user is currently logged (under NT of better. When interrogating Win9x machines, NetWkstaGetInfo will retrieve the OS information, however the call to NetWkstaUserEnum returns "not available", as this API has no meaning to a Win9x machine).

    The WKSTA_INFO_102 structure used by NetWkstaGetInfo returns information about a workstation environment, including platform-specific information, the names of the domain (or workgroup) and the local computer, number of users logged on to the local computer, as well as information concerning the operating system on the machine.

    The WKSTA_USER_INFO_1 used by NetWkstaUserEnum returns the name of the user currently logged on to the workstation, the name of the domain in which the user is currently logged on, the name of the computer that authenticated the server, as well as any other domains browsed by the workstation.




Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured