Hi guys,
I get the below from the other thread. now I get it working in my local computer, but i want is to get the process of the other computer. I know that it has the capability to do so but the problem is it can't get the processes on a computer that has a password. Kindly help please.
Thanks and God bless
ProcessID Code:
Option Explicit Private Sub Form_Load() Dim strComputer As String Dim sReturn As String Dim strNameOfUser As Variant Dim colProcesses As Object Dim objProcess As Object strComputer = "." '"." local or "\\ComputerName" Set colProcesses = GetObject("winmgmts:{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2").ExecQuery("Select * from Win32_Process") For Each objProcess In colProcesses sReturn = objProcess.GetOwner(strNameOfUser) If sReturn <> 0 Then MsgBox "Could not get owner info for process " & objProcess.Name & vbNewLine & "Error = " & sReturn Else MsgBox "Process " & objProcess.Name & " is owned by " & "\" & strNameOfUser & "." End If Next End Sub




Reply With Quote