Access Denied

Symptom: Access Denied

"Access is denied. (Exception from HRESULT: 0x80070005 (E_ACCESSDENIED))"

Solution: Change DCOM permissions

  1. Log in to your target machine
  2. Open dcomcnfg
  3. Expand Component Service > Computers > My Computer
  4. Right-click My Computer > Properties
  5. Select the COM Security tab
  6. Under Access Permissions > Edit Limits > Add > your user
    Select Local Access and Remote Access
  7. Under Launch and Activation Permissions go to Edit Limits > Add > target-machine\your user
    Ensure it has all of the permissions checked under Allow:
    Local Launch, Remote Launch, Local Activation and Remote Activation
  8. Click OK > OK, and exit Component Services


Solution: Add permissions to the WMI namespace

  1. Log in to your target machine
  2. Open wmimgmt.msc
  3. From the left pane, properties, right-click WMI Control (local)
  4. Select the Security tab
  5. Expand Root > CIMV2 click Security
  6. Add  target-machine\your user and click OK.
  7. In the Permissions for... pane, Allow column, check Remote Enable.
For more complete information about compiler optimizations, see our Optimization Notice.