Security Error in WMI Connection

0

When trying to fetch running process details from a Windows 2008 server, I get the error code -2147217405 (0x80041003). I've read that it's a security issue. I'm connecting using a C++ MFC dialog-based application and have performed the following steps:

  1. CoInitializeEx()
  2. CoInitializeSecurity()
  3. CoCreateInstance()
  4. CoSetProxyBlanket()
hres = CoSetProxyBlanket(
            pSvc,                        // Indicates the proxy to set
            RPC_C_AUTHN_DEFAULT,         // RPC_C_AUTHN_xxx
            RPC_C_AUTHZ_DEFAULT,         // RPC_C_AUTHZ_xxx
            COLE_DEFAULT_PRINCIPAL,      // Server principal name 
            RPC_C_AUTHN_LEVEL_DEFAULT,   // RPC_C_AUTHN_LEVEL_xxx
            RPC_C_IMP_LEVEL_IMPERSONATE, // RPC_C_IMP_LEVEL_xxx
            NULL,                        // client identity
            EOAC_NONE                    // proxy capabilities
        );

I haven't used the COAUTHIDENTITY structure to provide credentials for setting the proxy security.

Thank you in advance.

c++
windows
mfc
wmi
remote-access
asked on Stack Overflow May 18, 2015 by Mithun Bhaskar • edited May 18, 2015 by Eryk Sun

0 Answers

Nobody has answered this question yet.


User contributions licensed under CC BY-SA 3.0