Question

Install Certificate to Trusted Root CA in Windows

  • 30 March 2023
  • 2 replies
  • 219 views

Badge

Hi all, first time posting in here!

Was hoping the Automox community could help me. Is there a Worklet at all for pushing out a Certificate in Windows to the Trusted Root CA?  I can see that there is one for Mac in the built in Worklet catalog but no sign of a Windows one

Any help would be appreciated!

Thank you


2 replies

Do your know Worklet. Upload the cert. to it.

Then do this:

$file = "CERT FILE NAME GOES HERE"

#Adds the certificate to Computer Trusted Root Authority
Import-Certificate -FilePath $file -CertStoreLocation Cert:\LocalMachine\Root

Userlevel 5
Badge +1

You can add this to evaluation to see if the certificate exists too

 

$cert  = Get-ChildItem Cert:\LocalMachine\Root | Where-Object Thumbprint -eq "you-certificates-thumbprint"
IF(!$cert)
{
    exit 1
}

Reply