PDA

Click to See Complete Forum and Search --> : Users Logged in NT


minnal
Nov 11th, 1999, 06:35 PM
Hi Guys,

I would like to know whether it is possible to get all the users logged in the NT Network.
If Possible please provide me with the code.

This is very very urgent.
I have tried with some API's but n vain.

Thanx
minnal

clefus
Nov 12th, 1999, 08:20 AM
Under Windows 95, the computer can be set up so that many different users can log into the computer. The name of current user can be retrieved by using the following code.


Dim s As String
Dim cnt As Long
Dim dl As Long
Dim CurUser as String
cnt = 199
s = String$(200, 0)
dl = GetUserName(s, cnt)
If dl <> 0 Then curuser = Left$(s, cnt) Else curuser = ""
You must declare the following function in the declarations section of a form or module in the project.
Declare Function GetUserName Lib "advapi32.dll" Alias _
"GetUserNameA" (ByVal lpBuffer As String, nSize As Long) _
As Long

Remember this is for Win95, but it should tell you the login user of NT too.
I don't know about all the user logged on.