How to get over Access is denied. (E_ACCESSDENIED) when using our COM from under an account without enough rights - Advanced Installer Community
Catalin
Posts: 7847
Joined: Wed Jun 13, 2018 7:49 am

How to get over Access is denied. (E_ACCESSDENIED) when using our COM from under an account without enough rights

Hello,

Today we'll be discussing how to avoid the following error:
Retrieving the COM class factory for component with CLSID
{4D3B04E6-E766-4A9F-8129-D119FEF08A7F} failed:
80070005 Access is denied. (E_ACCESSDENIED)
When does this issue appear?

The common thread across every report I've seen is Session 0 + non-interactive execution, regardless of which specific automation tool sits on top. In this specific case, it was a GitLab Runner running as a Windows service, and a GitHub Actions runner "operating as a Windows service" under the same account

Basically, when trying to use the COM object (e.g. PowerShell automation support) from under an account that does not have enough rights (e.g. the LocalService account).

In my specific case, I managed to reproduce this using a Scheduled Task that runs interactively under the LocalService account.

Note: Please note that this is for the sake of the example, in most cases, the user differs, but the issue is the same and that is the lack of privileges.

First of all, this is an issue that we can work around starting with version 24.0. Currently, this version is not available as of the writing of this article. For the clients facing this issue, I have provided a RC version. For future clients facing this issue, please make sure to have 24.0 version installed or a higher version.

Here are the steps to fix this:

1. install version 24.0 of Advanced Installer (or higher)

2. open "Component Services" --> "Computers" --> "My Computer" --> "DCOM Config"
Screenshot_176.png
Screenshot_176.png (139.65 KiB) Viewed 27228 times

3. here, right click on "Advanced Installer COM Server" and then click on "Properties"

4. in the new spawned window, go to the "Security" tab

5. for each of the 3 (Launch and Activation permissions, Access permissions, Configuration permissions) select "Customize"

6. use the "Add" button to add your user there
Screenshot_177.png
Screenshot_177.png (29 KiB) Viewed 27228 times

7. after adding the user, select it and grant it permissions:
Screenshot_178.png
Screenshot_178.png (60.72 KiB) Viewed 27228 times

8. repeat this for the two that are left

9. click "Apply" and then "Ok"

10. retest this


By following these steps, you should now be able to use the COM object from under an account that runs in session 0 and that previously did not have enough rights.


Hope you'll find this useful! :D

Best regards,
Catalin
Catalin Gheorghe - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Sample Projects”