|
-
Oct 20th, 2007, 09:25 PM
#1
Thread Starter
Hyperactive Member
getting process on a network pc
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
-
Oct 21st, 2007, 06:37 AM
#2
Re: getting process on a network pc
Have you tried feeding it the password?
-
Oct 21st, 2007, 07:10 AM
#3
Thread Starter
Hyperactive Member
Re: getting process on a network pc
No, sad say i don't kno how
-
Oct 21st, 2007, 07:24 AM
#4
Re: getting process on a network pc
If you don't know the password, then you shouldn't be accessing the machine in the first place.
-
Oct 21st, 2007, 10:06 AM
#5
Thread Starter
Hyperactive Member
Re: getting process on a network pc
i mean is i don't know how to feed the password through that code but i know the password of the pc. i have the access to the pc and i have the administrator account since we are on the development team. i just couldn't get the process on a pc with a password.
-
Oct 22nd, 2007, 08:14 AM
#6
Thread Starter
Hyperactive Member
Re: getting process on a network pc
-
Oct 22nd, 2007, 07:48 PM
#7
Thread Starter
Hyperactive Member
Re: getting process on a network pc
i am getting a dead end on this. Is it possible to suppy a password with the above code?
-
Oct 23rd, 2007, 03:08 AM
#8
Re: getting process on a network pc
You need to have administrator permissions or it will fail.
See my CodeBank thread on the subject
http://vbforums.com/showthread.php?t=358108
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
-
Oct 23rd, 2007, 04:32 AM
#9
Thread Starter
Hyperactive Member
Re: getting process on a network pc
so i need to log as administrator on my machine or is there anything i need to setup on the remote pc to give me an admistrator account?
-
Oct 23rd, 2007, 05:19 PM
#10
Re: getting process on a network pc
You need to be in the Administraotrs group on your network.
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
-
Oct 25th, 2007, 01:52 AM
#11
Thread Starter
Hyperactive Member
Re: getting process on a network pc
sorry Rob for being a slow @%%, please bear with me.
now, with regards with the network, we do only have a simple workgroup. How can i set my account as administrator? The account of the pc that i am using is Adminstrator. now i tried to add an account to my remote pc and put the same password as on my pc but to no avail i always get permission denied.
-
Oct 25th, 2007, 03:37 AM
#12
Re: getting process on a network pc
No prob I think with a workgroup it will be different as each computer doesnt know what accounts are on the other computers. You may need to create an administrator account on the other system with the same credientials as yours. Then it may carry over but not 100% sure.
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
-
Oct 25th, 2007, 03:42 AM
#13
Thread Starter
Hyperactive Member
Re: getting process on a network pc
will different os will be an issue? I am having a win2003 and the pc that i am trying to connect is xp. Now, what i did is i used the administrator account on my pc and changed its password with the password of the remote. but to no avail, i got the same error. thanks
-
Oct 25th, 2007, 04:30 AM
#14
Re: getting process on a network pc
Hmm, maybe its prefixed with the machine name.
user: \\somemachinename\administrator
pwd: *******
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
-
Oct 25th, 2007, 04:56 AM
#15
Thread Starter
Hyperactive Member
Re: getting process on a network pc
How will i put that on code|?
-
Oct 25th, 2007, 09:33 AM
#16
Re: getting process on a network pc
No, I was just stating that the two accounts may still be seen as different. There is no place for passing logon credentials with WMI in this code. I dont think its possible with a workgroup.
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
-
Oct 25th, 2007, 08:01 PM
#17
Thread Starter
Hyperactive Member
Re: getting process on a network pc
thanks rob, sad that i can't used it as of now. anyway your code is a beauty though.
-
Oct 25th, 2007, 09:01 PM
#18
Re: getting process on a network pc
Thanks but dont give up searching as I may be wrong, it happens from time to time .
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|