How to install a Certificates using powershell script How to install a Certificates using powershell script powershell powershell

How to install a Certificates using powershell script


The problem here is that when you install the certificate to Cert:\CurrentUser\Root (Trusted Root CAs in the current user account), underlying CryptoAPI invokes the following dialog:

enter image description here

And this is why error message mentions UI. Since you are attempting to install the certificate in the remoting session it is impossible to press the button in the remote host's interactive session. This is why UI dialogs are prohibited.

What you can do is to install the certificate to Local Machine store. That is, install it to Cert:\LocalMachine\Root.

Note that when installing a root certificate to the local machine store, it is automatically propagated to all user accounts on that machine. That is, an unintentional trust can be established for users where such trust might not be supposed.