import-gvhistory: Export Google Voice SMS/Text Messages and Call logs to CSV using Powershell

Here is a script I wrote to parse the thousands of HTML files produced by Google Takeout when exporting Google Voice data.  This script parses the html files to gather the Contact Name, Number, time, type (Placed/received etc), duration, and (text/voicemail) message contents for every phone call and text message, and outputs them as a powershell object which can be further filtered or manipulated and then exported into a csv or other format as needed.

Basic examples of how to use this script are included in the script comments.  If you download the script and have trouble, or if it works perfectly, please leave a comment and let me know.

**Update 12/20/2014** I've just posted step by step instructions for how to use the script..
**Update 11/16/2015** The script has been updated due to a change in how Google Takeout exports the timestamps.

Comments

  1. Hey. First and foremost, thank you for writing this. I've been looking for a way to make this data useful for a while. That being said, I'm having trouble getting this to work. I'm pretty new to PowerShell so I could just be doing something wrong but as of now, running the script just yields an empty CSV (or nothing at all if I don't include the export-csv part). Some guidance would be much appreciated. Thanks in advance!

    ReplyDelete
    Replies
    1. Thanks Peter. I've added a new post with step by step instructions, and updated this post with a link. If you have any more trouble let me know.

      Delete
    2. Thanks for the update and all of your help! The script wound up working perfectly!

      Delete
  2. I'm getting the following error when I run the script:

    Cannot find an appropriate constructor to instantiate the custom attribute object for type 'Alias'.
    At C:\temp\gvtext\import-gvhistory.ps1:32 char:11
    + [Alias <<<< ()]
    + CategoryInfo : InvalidOperation: (Alias:Token) [], Run
    + FullyQualifiedErrorId : CannotFindConstructorForCustomAttribute

    I'm sure it's probably something that should be obvious, but any help appreciated.

    ReplyDelete
    Replies
    1. Dann - That sounds like one of the same issues that Peter ran into. While you can safely comment out line 32 by putting a # at the beginning of the line, I suspect that the root of the issue may be that you're running an old version of powershell. Do you know which version your using?

      Win7 shipped with Powershell v2.0, but you can get version 4.0 (the latest available for Win7 currently) by downloading and installing the "Windows Management Framework 4" package from Microsoft. If you're running Windows 7 and don't have that installed already, then that's probably your issue.

      Delete
    2. That was it. Figured it'd be something like that. Thanks!

      Delete
  3. i am using 4.0 and I get a bunch of these errors:

    New-Object : Cannot find type [HtmlAgilityPack.HtmlDocument]: verify that the assembly containing this type is loaded.
    At C:\voice\import-gvhistory.ps1:94 char:20
    + $doc = New-Object HtmlAgilityPack.HtmlDocument
    + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo : InvalidType: (:) [New-Object], PSArgumentException
    + FullyQualifiedErrorId : TypeNotFound,Microsoft.PowerShell.Commands.NewObjectCommand

    ReplyDelete
    Replies
    1. Houstonsolo - That error looks like the script wasn't able to access htmlagilitypack.dll for some reason. Make sure you have downloaded the html agility pack and extracted the appropriate dll file into the same directory as the script, and that you are in that directory when you run the script. In my post with step by step instructions, I used "c:\temp" as the working directory for this.

      Delete

Post a Comment

Popular posts from this blog

Data Sharing Service crashes on Windows Server 2016 - Event ID 7023

Automate cleanup of CB Defense sensor after a failed uninstall using SCCM

Windows 10 Credential Guard breaks WiFi