Is it possible to search for password protected Microsoft office (word or excel) files? I have forgotten some passwords and am trying to recover them. I noticed a password protected file is not 'locked' per se, it just has a lock symbol for preview. Is there something that can be put into the Terminal? I tried finder security, it does NOT work at all. Thank you
1 Answer
You can use mdfind
in Terminal like so:
mdfind "kMDItemSecurityMethod == 'Password Encrypted'"
It will print all the files that are password encrypted.
-
On Monterey, lists a lot of pdf files but not the password-protected Word or Excel files.– AlperCommented Aug 16, 2022 at 9:19
-
2Ok I didn't know that I have no Word nor Excel installed on my machine, so I can't check if those files have anything stored in their metadata. Please run
mdls FILE_TO_CHECK.doc
and see if there's anything related to password protection. Commented Aug 16, 2022 at 9:43 -
2Sadly, I don't think a Spotlight search (either in Finder or
mdfind
) can work, because (by experiment) the Spotlight Importer for Word (and I assume Excel) does not populate any suitable Spotlight metadata related to password-protection.– GilbyCommented Aug 16, 2022 at 10:23