Quickly reset Firefox’s certificate store and exceptions

Hey there,

A quick PowerShell function to reset the certificate store and certificate exceptions for all firefox profiles. Can be handy in organisations when performing tests with certificate configuration and firefox.

shack/Reset-MAKFirefoxCertificateSettings.ps1


Function Reset-MAKFirefoxCertificateSettings{
# Certificate DB and exceptions reset
If(Get-Process -Name "firefox" -ErrorAction SilentlyContinue){Stop-Process -Name "firefox"}
Get-ChildItem -Path "$Env:APPDATA\Mozilla\Firefox\Profiles" -Recurse -Include "cert8.db","cert_override.txt" | ForEach-Object {
If(Get-ChildItem -Path "$Env:APPDATA\Mozilla\Firefox\Profiles" -Recurse -Include "$($_.Name).old" -ErrorAction SilentlyContinue){
Remove-Item -Path "$Env:APPDATA\Mozilla\Firefox\Profiles" -Recurse -Include "$($_.Name).old"
}
Rename-Item -Path $_ -NewName "$($_.Name).old"
}
}

Read-Host -Prompt "Press a key to continue and reset the Firefox settings."
Reset-MAKFirefoxCertificateSettings

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s