Re: "Access is denied" on local machine
- From: "Richard T. Edwards" <r.t.edwards@xxxxxxxxxxx>
- Date: Tue, 27 Sep 2005 19:34:38 -0400
The one thing that strikes me right away is your AuthnLevel:6. This is the
highest level of authentication you can use.
Try using 3.
> All these calls are returning correctly, and the code actually fails
> with the appropriate error when I try to enumerate the results of a
> query.
Yep. That is exactly what every other programmer in every other language
will get if the permissions aren't correct.
That's when it happens.
hth.
"rbgibbons" <rbgibbons@xxxxxxxxx> wrote in message
news:1127866800.325250.231760@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
>I have a problem that is eluding me. We have windows service WMI
> application. Thus, it's accessing the local machine using the local
> system account. On most machines it works nicely. On one particular
> machine, it fails with the "Access is denied" error code (0x80070005).
>
> I've run CoQueryProxyBlanket, and received the following results,
> identical to the results that I get from a working machine:
> AuthnSvc: 10
> AuthzSvc: 0
> ServerPrincName: NT AUTHORITY\SYSTEM
> AuthnLevel: 6
> ImpLevel: 3
> Capabilities: 0
>
> One distinguishing feature of the machine is that, while it is
> WindowsXP, it does not have any of the Windows XP service packs
> installed.
>
> The relevant code (with error handling removed):
>
> hr = ::CoCreateInstance(CLSID_WbemLocator, 0,
> CLSCTX_INPROC_SERVER,
> IID_IWbemLocator,
> (LPVOID *) &pLoc);
>
>
> // Connect to the root\default namespace with the current user.
> hr = pLoc->ConnectServer(_bstr_t(L"ROOT\\CIMV2"),
> NULL, NULL, 0, NULL, 0, 0, &m_WBEMService);
>
> hr = CoQueryProxyBlanket(m_WBEMService,
> &dwAuthService,
> &dwAuthZService,
> &name,
> &dwAuthLevel,
> &dwImpLevel,
> NULL,
> &dwCapabilities);
>
> hr = CoSetProxyBlanket(m_WBEMService,
> RPC_C_AUTHN_DEFAULT,
> RPC_C_AUTHZ_NONE,
> NULL,
> dwAuthLevel,
> RPC_C_IMP_LEVEL_IMPERSONATE,
> NULL,
> EOAC_NONE);
>
> All these calls are returning correctly, and the code actually fails
> with the appropriate error when I try to enumerate the results of a
> query.
>
> I'm baffled as to why this isn't working, and am looking for thoughts
> about ways to diagnose this programmatically. Since this is software
> intended for end users, I have to be able to identify the problem
> programmatically, and either fix it, or tell the end user what the
> problem is, and so that they can install whatever patch is required to
> fix it.
>
> Any assistance would be appreciated.
>
> Thanks,
> Richard
>
.
- Follow-Ups:
- Re: "Access is denied" on local machine
- From: rbgibbons
- Re: "Access is denied" on local machine
- References:
- "Access is denied" on local machine
- From: rbgibbons
- "Access is denied" on local machine
- Prev by Date: RE: WinMgmt File Lock and CancelAsyncCall Questions
- Next by Date: "Access is denied" on local machine
- Previous by thread: "Access is denied" on local machine
- Next by thread: Re: "Access is denied" on local machine
- Index(es):
Relevant Pages
|