Category filter
Script to deploy trusted CA certificates on Windows 10
Deploying trusted CA certificates to the devices in a work environment is crucial since certificates enable streamlined access to various services. They act as credentials, authenticate clients, perform encryption/decryption and can also be used to sign messages digitally. Though the uses may vary, organizations might be looking out for possible ways to install them without involving a hands-on approach. The Execute Custom Script action helps you embed necessary commands and run them on numerous computers altogether. This doc helps you with scripts that can be used for installing certificates on Windows 10 devices.
PowerShell script to install certificates
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 |
try { Write-Host "starting script execution" #manifest URL $download_url = "manifest URL" $local_path = "C:\Hexnode\certificate.cer"#extension according to the type of certificate file in the url $WebClient = New-Object System.Net.WebClient Write-Host "downloading certificate from manifest url" #downloading certificate from manifest url $WebClient.DownloadFile($download_url, $local_path) Write-Host "downloading completed`nInstalling certificate" #installing certificate in trusted Root CA certutil -addstore Root $local_path Write-Host "script execution completed" } catch [Exception] { write-host $_ | out-string } |
You can also use the Import-Certificate cmdlet to import certificates to the certificate store.
1 |
Import-Certificate -FilePath "C:\Users\Xyz\Desktop\BackupCert.Cer" -CertStoreLocation Cert:\LocalMachine\Root |