Hi WinSigningQuery,
The Access Denied error is Windows working as designed. Each user's Root store is protected, so a root certificate can only be added after that user confirms a security prompt in their own session, and an administrator can't give that consent for them.
Read-only checks:
- Run
reg query "HKLM\SOFTWARE\Policies\Microsoft\SystemCertificates\Root\ProtectedRoots" /v Flags. If bit 0x1 is set, a policy blocks per-user roots completely. If it isn't set, only the user's consent is missing. - In
secpol.msc> User Rights Assignment, check whether the account is denied local logon. If it is, the user can never see the prompt, and that's something your application needs to address.
Supported fix (this account only): Sign in once as the dedicated account (or use runas /user:<account> powershell), import the certificate into Cert:\CurrentUser\Root and accept the prompt, then import it into Cert:\CurrentUser\TrustedPublisher as well. After that, AllSigned scripts will run non-interactively under that account, and machine-wide trust stays untouched.
I hope the response provided some helpful insight. If you find this answer useful, please hit “accept answer” so I know it addressed your concern.
Jason