|
-
May 28th, 2007, 07:04 PM
#1
Remote Execute (RPC) failing Win32_Process with E_ACCESSDENIED
I'm trying to execute a command on a remote machine using WMI, and it's failing in the following line of code:
hRes = pService->GetObject(_bstr_t(L"Win32_Process"), NULL, NULL, &pProcess, NULL);
if(FAILED(hRes))
{
return E_FAIL; // Fails here
}
For full code, see following links:
code.axter.com/cprocess.h
code.axter.com/cprocess.cpp
Does anyone know why I would get this failure, and how to fix it?
Last edited by Axter; May 29th, 2007 at 05:13 AM.
-
May 28th, 2007, 07:18 PM
#2
Re: Remote Execute (RPC) failing Win32_Process with E_ACCESSDENIED
You should examine the returned value hRes for valuable information.
Take a look at the _com_error class.
- petter
-
May 28th, 2007, 07:31 PM
#3
Re: Remote Execute (RPC) failing Win32_Process with E_ACCESSDENIED
I forgot to include this in the body of the question, but if you look at the question title, you'll notice I stated that it's returning E_ACCESSDENIED
-
May 28th, 2007, 07:32 PM
#4
Re: Remote Execute (RPC) failing Win32_Process with E_ACCESSDENIED
For full code, see following links:
code.axter.com/cprocess.h
code.axter.com/cprocess.cpp
I can not open this link, but it something like This
Little by little one goes far
Keep moving.......!
Nothing is impossible !
-
May 28th, 2007, 07:36 PM
#5
Re: Remote Execute (RPC) failing Win32_Process with E_ACCESSDENIED
 Originally Posted by Axter
I forgot to include this in the body of the question, but if you look at the question title, you'll notice I stated that it's returning E_ACCESSDENIED
Sorry. I read the title but somehow that didn't get through. Time to log off.
- petter
-
May 28th, 2007, 08:05 PM
#6
Re: Remote Execute (RPC) failing Win32_Process with E_ACCESSDENIED
and what's your development environment ?? Microsoft Visual Studio Extensions or others??
Little by little one goes far
Keep moving.......!
Nothing is impossible !
-
May 29th, 2007, 05:10 AM
#7
Re: Remote Execute (RPC) failing Win32_Process with E_ACCESSDENIED
I can not open this link, but it something like This
Yes.
Now I know the true source of this code. I got it from another web site, but I guess they got it from here.
Did you try putting http in front of it?
http://code.axter.com/cprocess.h
http:// code.axter.com/cprocess.cpp
Last edited by Axter; May 29th, 2007 at 05:20 AM.
-
May 29th, 2007, 05:17 AM
#8
Re: Remote Execute (RPC) failing Win32_Process with E_ACCESSDENIED
and what's your development environment ?? Microsoft Visual Studio Extensions or others??
I'm using VC++ 8.0 (2005)
The project is compiled as a regular console application.
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
|