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?
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
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
Re: Remote Execute (RPC) failing Win32_Process with E_ACCESSDENIED
Quote:
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
Re: Remote Execute (RPC) failing Win32_Process with E_ACCESSDENIED
Quote:
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
Re: Remote Execute (RPC) failing Win32_Process with E_ACCESSDENIED
and what's your development environment ?? Microsoft Visual Studio Extensions or others??
Re: Remote Execute (RPC) failing Win32_Process with E_ACCESSDENIED
Quote:
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
Re: Remote Execute (RPC) failing Win32_Process with E_ACCESSDENIED
Quote:
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.