Problem: I have multiple firewall certificates to import to a machines trusted root certificate authority
Solution: In my current role we use Watchguard hardware firewalls, each of which has its own proxy authority certificate that needs importing to Trusted Root Certificate Authority store on the local machine. On our domains this is easy to do with group policy but as a roaming machine off the domain an engineers laptop needs to manually install them. To make this easier than using GUI we can use our trusted friend PowerShell.
Here is the script I wrote for it:
So first we set our certificate path location and file type for the certificate:
Next we look into the path for all files of the specified type
Then a simple for each statement with a counter to increment after each addition. For each certificate found the function runs importing the certificate to the correct location (Trusted Root Certificate Authority store) and incrementing the counter, repeating until finished. Once finished it writes to the host it has done it correctly (Write-Host = bad I know, it serves a small purpose for me on this script) then finally giving out an indication of how many certificates were imported by giving out the total count
.You can download the script here: