Outlook Bulk Remove Encryption

PowerShell Script to scan through specified Outlook folder and remove the encryption flag on each email.

Background: We tend to cycle smart cards over the years in my environment. The old certs from those cards must be maintained in order to be able to pull up old emails sent to you which were encrypted with your old public key(s). This also makes it interesting to hand off a PST full of emails piled up as a simple knowledge base to someone else, since you really wouldn’t want to give them your certs of course.  Removing the encryption flag via the Outlook COM API turns out to be pleasantly trivial… literally just one line of code and a resave. The rest of this script is a simple UI and the optional folder recursion logic. If you don’t have a particular cert loaded, the script will output the subject of the failed message and then it’s a matter of getting that missing cert loaded on your system and retrying.

  • PME

    Hello! Great Script. Works perfectly well.
    One questions: Is it possible to run this script in the background every time a new e-mail is received (or sent)? Do you have an idea how to do this (via VBA->Rules I guess)?
    Thank you very much for your help! Best regards, Patrick

  • @PME – Hey cool, it's always nice to get some confirmation that it works for others.

    For a quick answer to your question, Google "NewMailEx powershell", the first few hits look helpful.

  • Pingback: Outlook Bulk Remove Encryption | /* BeejBlog */ | Soyka's Blog()