SharePoint / Script to locate documents encrypted with passwords

Summary

A customer asked if there was a method to identity documents stored in SharePoint online that were encrypted with passwords. Since nothing like this existed, it was created using PowerShell. I’m sharing this because the logic in the script may be useful for others.

The Code

Takeaways

This scripts loops though a specified document library and reads the first 200 binary bytes as text. If the encrypted string is found, the document URL is reported in the console output.

Here is an example of the output:

You will need a few things to make this works.

  1. Installed the SharePoint Online Client Components SDK
  1. Specify the “$SiteURL, $Listname and $username in the script.

Leave a Reply