Click here to Skip to main content
15,886,757 members
Home / Discussions / Visual Basic
   

Visual Basic

 
GeneralRe: SQL Configuration Pin
DinoRondelly13-Nov-12 18:17
DinoRondelly13-Nov-12 18:17 
QuestionSource Code Pin
tesraghavan12-Nov-12 15:59
tesraghavan12-Nov-12 15:59 
AnswerRe: Source Code Pin
Dave Kreskowiak13-Nov-12 2:20
mveDave Kreskowiak13-Nov-12 2:20 
QuestionMonitoring Network Usage For Remote Users Pin
DinoRondelly12-Nov-12 10:54
DinoRondelly12-Nov-12 10:54 
AnswerRe: Monitoring Network Usage For Remote Users Pin
Eddy Vluggen13-Nov-12 11:44
professionalEddy Vluggen13-Nov-12 11:44 
QuestionScan Multipage Tiff Image For A Barcode Pin
daveofgv12-Nov-12 4:07
daveofgv12-Nov-12 4:07 
AnswerRe: Scan Multipage Tiff Image For A Barcode Pin
Eddy Vluggen12-Nov-12 10:54
professionalEddy Vluggen12-Nov-12 10:54 
QuestionGetting All Logged On Users and IP VB.net Pin
DinoRondelly12-Nov-12 3:39
DinoRondelly12-Nov-12 3:39 
I am trying to get all logged on users and their IPAddresses and display them in a data grid veiw in a windows form using VB.net I have tried the below code and it appears to get the users on a windows 7 machine but not on servers. Any information on this would be greatly appreciated.

VB
Public Shared Function GetUsers() As List(Of Users)

    Dim UserList As New List(Of Users)

    Try
        ' WhereDomain=""BLABLA"""
        Using searcher = New ManagementObjectSearcher("root\CIMV2", "SELECT * FROM Win32_LogonSession WHERE LogOnType = 2")

            For Each queryObj As ManagementObject In searcher.Get()

                Dim qry As String = "Associators of " _
                                 & "{Win32_LogonSession.LogonId=" & queryObj.GetPropertyValue("LogonId") & "} " _
                                 & "Where AssocClass=Win32_LoggedOnUser Role=Dependent"

                Using iSearch = New ManagementObjectSearcher(qry)

                    For Each res As ManagementObject In iSearch.Get()

                        Dim ret As New Users(res.GetPropertyValue("Name"), _
                                         "", "")

                        UserList.Add(ret)
                    Next


                End Using
            Next
        End Using

        Return UserList

    Catch err As ManagementException

        MessageBox.Show(err.Message)
        Return UserList

    End Try

End Function

AnswerRe: Getting All Logged On Users and IP VB.net Pin
Dave Kreskowiak12-Nov-12 4:37
mveDave Kreskowiak12-Nov-12 4:37 
GeneralRe: Getting All Logged On Users and IP VB.net Pin
DinoRondelly12-Nov-12 4:44
DinoRondelly12-Nov-12 4:44 
GeneralRe: Getting All Logged On Users and IP VB.net Pin
Dave Kreskowiak12-Nov-12 4:52
mveDave Kreskowiak12-Nov-12 4:52 
GeneralRe: Getting All Logged On Users and IP VB.net Pin
DinoRondelly12-Nov-12 4:55
DinoRondelly12-Nov-12 4:55 
GeneralRe: Getting All Logged On Users and IP VB.net Pin
Dave Kreskowiak12-Nov-12 5:55
mveDave Kreskowiak12-Nov-12 5:55 
GeneralRe: Getting All Logged On Users and IP VB.net Pin
DinoRondelly12-Nov-12 6:11
DinoRondelly12-Nov-12 6:11 
GeneralRe: Getting All Logged On Users and IP VB.net Pin
Dave Kreskowiak12-Nov-12 6:46
mveDave Kreskowiak12-Nov-12 6:46 
AnswerRe: Getting All Logged On Users and IP VB.net Pin
DinoRondelly12-Nov-12 8:05
DinoRondelly12-Nov-12 8:05 
GeneralRe: Getting All Logged On Users and IP VB.net Pin
Dave Kreskowiak12-Nov-12 10:02
mveDave Kreskowiak12-Nov-12 10:02 
QuestionModule error> PLEASE HELP! Pin
leashim11-Nov-12 13:57
leashim11-Nov-12 13:57 
AnswerRe: Module error> PLEASE HELP! Pin
Dave Kreskowiak11-Nov-12 17:08
mveDave Kreskowiak11-Nov-12 17:08 
QuestionPizza order form Pin
Ritchie Vasquez11-Nov-12 5:59
Ritchie Vasquez11-Nov-12 5:59 
AnswerRe: Pizza order form Pin
Richard MacCutchan11-Nov-12 6:21
mveRichard MacCutchan11-Nov-12 6:21 
Questioncheck smtp connection before sending ? Pin
alejx9-Nov-12 9:02
alejx9-Nov-12 9:02 
AnswerRe: check smtp connection before sending ? Pin
Dave Kreskowiak9-Nov-12 9:52
mveDave Kreskowiak9-Nov-12 9:52 
GeneralRe: check smtp connection before sending ? Pin
alejx9-Nov-12 13:47
alejx9-Nov-12 13:47 
GeneralRe: check smtp connection before sending ? Pin
Dave Kreskowiak9-Nov-12 14:15
mveDave Kreskowiak9-Nov-12 14:15 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.