Home > Exchange Server, PowerShell > Function: Get-PstFiles – List All .pst Files In A Given Path, With Name, Path, Size, and Owner

Function: Get-PstFiles – List All .pst Files In A Given Path, With Name, Path, Size, and Owner

Exchange 2013 logo 128x128Description

If you need to make a list of the .pst files in a given path, this function should help. It will get all .pst files, their name, path, size (in MB), and owner. This should help if you’re looking at importing the files in Exchange Server. If you’d like to export the results to a file, use the -file switch, with a filename, and the function will save the info to a .csv file.

Syntax

Get-PstFiles [[-path] ] [[-filter] ] [[-file] ] [-WhatIf] [-Confirm] []

Donations

I’ve never been one to really solicit donations for my work. My offerings are created because *I* need to solve a problem, and once I do, it makes sense to offer the results of my work to the public. I mean, let’s face it: I can’t be the only one with that particular issue, right? Quite often, to my surprise, I’m asked why I don’t have a “donate” button so people can donate a few bucks. I’ve never really put much thought into it. But those inquiries are coming more often now, so I’m yielding to them. If you’d like to donate, you can send a few bucks via PayPal at https://www.paypal.me/PatRichard. Money collected from that will go to the costs of my website (hosting and domain names), as well as to my home lab.

Download

v1.1 – 05-13-2013 Get-PstFiles.v1.1.zip

  1. August 13th, 2013 at 11:26 | #1

    Don’t forget the recommended scripting best practice is not to use aliases, especially the ones like % and ?. Also, your comments say the script won’t accept pipelined input, but your script says otherwise. You might consider a validation test on path using Test-Path.

    • Pat Richard
      August 13th, 2013 at 19:26 | #2

      Updated in the next release.

  1. May 17th, 2013 at 20:15 | #1
  2. June 13th, 2013 at 11:13 | #2