09-06-20 01:50 PM
Answered! Go to Answer.
08-07-20 06:51 PM
Public Function GetLoggedInUsers() As ICollection(Of String) Dim users As New List(Of String) Dim moReturn As Management.ManagementObjectCollection Dim moSearch As Management.ManagementObjectSearcher Dim mo As Management.ManagementObject ' Retrieve a list of "explorer.exe" processes running on the system. Each logged in ' user session will have exactly one "explorer.exe" session. moSearch = New Management.ManagementObjectSearcher("Select * from Win32_Process Where name='explorer.exe'") moReturn = moSearch.Get ' Cycle through the returned process instances and get the owner of each. For Each mo In moReturn Dim arOwner(2) As String mo.InvokeMethod("GetOwner", arOwner) users.Add(arOwner(1) & "\" & arOwner(0)) Next Return users End Function
Cheers,
13-06-20 06:12 PM
15-06-20 02:02 PM
16-06-20 12:05 AM
16-06-20 02:04 PM
16-06-20 07:27 PM
19-06-20 01:48 PM
07-07-20 06:22 PM
08-07-20 05:41 AM
08-07-20 12:36 PM