WinBatch® Technical Support Forum

All Things WinBatch => WinBatch => Topic started by: wbrd on February 03, 2016, 11:32:13 AM

Title: Detect password protected PST file
Post by: wbrd on February 03, 2016, 11:32:13 AM
Hi
I was wondering if there is a way to programmatically check if a PST file is password protected.
Reason I am asking is that I have to migrate users' profile to a new DFS location. I want to proactively scan users' profile folders and if there are any password protected PST file I can inform the users ahead of time as to what to do before/after the migration is completed.
thanks
Title: Re: Detect password protected PST file
Post by: td on February 03, 2016, 01:13:41 PM
A shot in the dark but maybe attempt to enumerate contacts in the default Outlook folder or some other similar task.  If the attempt fails, you could assume the file is encrypted.   Here's  a contacts example:

http://techsupt.winbatch.com/webcgi/webbatch.exe?techsupt/nftechsupt.web+WinBatch/OLE~COM~ADO~CDO~ADSI~LDAP/OLE~and~Outlook+Find~Contacts~in~Outlook.txt (http://techsupt.winbatch.com/webcgi/webbatch.exe?techsupt/nftechsupt.web+WinBatch/OLE~COM~ADO~CDO~ADSI~LDAP/OLE~and~Outlook+Find~Contacts~in~Outlook.txt)

Of course, you would need to add some error handling to trap when it fails but that shouldn't be too difficult.