Score:0

How to import a PFX certificate to LocalMachine/Personal via GPO

ph flag

I would like to deploy P12 certificate (for OpenVPN) to Windws Certificate Store, to be more precise to LocalMachine\Personal. The reason is the certificate will be protected at least by local admin password. 

Of course I can do it manually. It is easy to double click on the P12 file, provide local admin credentials and go through wizzard to its end. Then I can see the certificate in LocalMachine\Personal and I can connect my OpenVPN client (as normal user who is not admin).

But of course I dont want to do it manully for plenty of computers. That's why I used GPO to deliver

  • the P12 file to C:\Temp\Windows to all my computers
  • a BAT script which import the certificate and delete the P12 file
  • scheduled task which run this script

content of the BAT file

certutil -p "" -importpfx "C:\Windows\Temp\certificate.p12"
del "C:\Windows\Temp\certificate.p12"

I used "run as: System" in the scheduled tasks and yes. The certificate is imported to LocalMachine\Personal, I can see it there. But OpenVPN connection is not possible. I get error message that certificate was not found. It behaves like there is no imorted certificate. 

Do you know how to run the scheduled task as local admin?  Or do you know how to solve it if it is a permission issue? 

Thank you

I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.