I'm looking for the best way to back cold backups of the email on my client's PC.

Starting off with PowerShell, I would run this:

Get-ChildItem -Path 'C:\' -Filter '*.pst' -Recurse -ErrorAction SilentlyContinue |
  Select-Object -Expand Directory -Unique |
  Select-Object -Expand FullName

To search where the email file is. I would have to search for Thunderbird as well.

This would run each time the user shuts down the PC. It would look if the email file and the backup copy have a 48 hour time difference and would do it.

The issue with this method is that it has to go thru the ENTIRE C: drive in order to find it which is VERY slow from tests I've done.

By default, I can go to the default Outlook folder using the username variable but what if the user decides for some odd reason to put it somewhere else?

The reason we backup is because clients use POP3 to make "backups" of whatever is on the mail server and not fill up the email server. I've attempted to move serveral to IMAP but they refuse because they would rather store emails from years ago on their PCs. Also IMAP have issues making folders for some odd reason.

I hope someone could lend a hand

I dont know how to do it with thunderbird, but you could try this for outlook :

$o=New-Object -ComObject outlook.application
$pst=$ns.folders.store |?{$_.exchangeStoreType -eq 3} |select -expand filepath
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.