Click to See Complete Forum and Search --> : Finding number of users logged in on a windows system


varunengg
August 20th, 2002, 06:33 AM
Hi,

Can anyone suggest me a way to find out how many users are logged in to a Windows2000/NT/XP system.I need to develop an application preferably using VC++ to do this.Are there any Windows API functions available for this,or some DLL which can be used.

Regards
Varun

Kdr Kane
August 20th, 2002, 10:54 AM
I can't help you with the programming part.

But, you can use the following functions from the Platform SDK:NET_API_STATUS NetSessionEnum(
LPWSTR servername,
LPWSTR UncClientName,
LPWSTR username,
DWORD level,
LPBYTE *bufptr,
DWORD prefmaxlen,
LPDWORD entriesread,
LPDWORD totalentries,
LPDWORD resume_handle
);

NET_API_STATUS NetSessionGetInfo(
LPWSTR servername,
LPWSTR UncClientName,
LPWSTR username,
DWORD level,
LPBYTE *bufptr
);I'm sure you can determine if a user has multiple connections.