Declare Function NetUserGetInfo Lib "netapi32" (ByVal servername As String, ByVal username As String, ByVal level As Long, bufptr As Long) As Long
Thanks, Patrick !
I don't know how to use the API for enumerating of logged computers. I am able to see the all users (or computers) which logged on today, but I don't know if they are still logged. I do that with the code:
Sub Logged_Users() Dim DomainObj As Object, Domeniu As String
Domeniu = "icmrom" Set DomainObj = GetObject("WinNT://" & Domeniu)
DomainObj.Filter = Array("user" 'DomainObj.Filter = Array("computer" For Each UserObj In[/color] DomainObj On Error Resume Next If Day(UserObj.LastLogin) = Day(Date) And _
Month(UserObj.LastLogin) = Month(Date) And _
Year(UserObj.LastLogin) = Year(Date) Then Debug.Print UserObj.Name End If
On Error GoTo 0
Next
MsgBox "OK !", , "Finished job !" End Sub
Using "DomainObj.Filter = Array("computer"" I obtain a list with computers logged on......
Is there a way to see only the ones logged on at a specific time ?
I tried to use "UserObj.LastLogOff" like beeng < then "UserObj.LastLogin" but untortunatelly there are recorded only the logging off which have been done without closing the computer......
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.