How to display number of items per .pst file

Not open for further replies.


Senior Member
Outlook version
Outlook 2016 32 bit
Email Account
Office 365 Exchange
Is there an easy way to display the total number of items (so, inbox, sent, drafts, etc.) per email account, i.e. per .pst file.

I have multiple email accounts (different domains, Outlook, Gmail, 2 local providers, a number of archive .pst-files).

Right now, I have to go thru all the separate folders and make note of the items.


[PS] C:\Scripts\demo>Get-Help .\Get-MailboxReport.ps1


Get-MailboxReport.ps1 - Mailbox report generation script.

C:\Scripts\demo\Get-MailboxReport.ps1 [-database ] []

C:\Scripts\demo\Get-MailboxReport.ps1 [-file ] []

C:\Scripts\demo\Get-MailboxReport.ps1 [-server ] []

C:\Scripts\demo\Get-MailboxReport.ps1 [-mailbox ] []

C:\Scripts\demo\Get-MailboxReport.ps1 [-all] []

Generates a report of useful information for
the specified server, database, mailbox or list of mailboxes.
Use only one parameter at a time depending on the scope of
your mailbox report.

To see the examples, type: "get-help C:\Scripts\demo\Get-MailboxReport.ps1 -examples".
For more information, type: "get-help C:\Scripts\demo\Get-MailboxReport.ps1 -detailed".
For technical information, type: "get-help C:\Scripts\demo\Get-MailboxReport.ps1 -full".

Depending on which parameter you use the output will vary.

  • If you use the -mailbox parameter to query a single mailbox, then the output will appear in the console window. I don't really see the need to output a single mailbox's details to a CSV file.
  • If you use any of the other parameters, -server, -database, -file, or -all, the output will be written to a CSV file in the same folder you're running the script from.
  • You can use the optional -filename parameter to specify your own output file name
Once you've generated the CSV report you can open it with Excel and begin to analyze the data.

Thank you both.
@Maxjackman001 - regretfully nothing happens whilst running the Powershell script. Seems it isn't verified for Windows 10. Also I am running POP3 with PST files. Probably the script is meant for Exchange only.

@Diane - many thanks. Regretfully, same as what Jamie Klein on the 'Print a list of your Outlook folders' is writing: opens an blank email. I am using Office 2016. That aside, as it starts with my main account, inbox, it looks... as if I need to select/point each account and run the macro then, i.e. the macro may not go thru all the accounts and all the folders and sub-folders.
I am not sure about that though: it stops at creating a blank mail.

Oh .. please note: I am not familiar with VBA
(My knowledge ends at : Alt-F11, insert module, paste code and save/close...)

Yeah, the macro, as written, doesn't loop all of the stores. (But that can be fixed)

Do you get any error messages? it's working here to create a message, but it's popped up the background.
I didn't get any errors, just a blank mail was created and there it stopped.
So, start macro, select inbox + 'OK'.
Result: blank mail.

As said, I don't have knowledge of macro's/VBA.
Nonetheless I checked the script (abacadabra for me) but noticed 'MAPIFolder' showing up a few times.

I am using POP3 and the .pst files are located on a different partition, i.e. not in some default C:\Something folder.
MAPI vs POP - could that have something to do with it?
(merely a wild guess on my part)

Diane, please allow me to get back on this one.

I just discovered what I have been doing wrong...

When running the macro,one should select the mail account, so, e.g. (i.e. the top-level).
Outlook, like with me, may be configured to start in the Inbox and when executing the macro, with inbox selected, one will get an empty mail.
Sure ... it sound very logical indeed, but I was a bit puzzled...

SnagIt-10032018 112831.png
Ah... yes, thanks for pointing that out. I'll update the article to make sure that is clear.
Not open for further replies.
Similar threads
Thread starter Title Forum Replies Date
T How to find or display the sub-folder name for an Archive Search Using Outlook 10
Witzker Outlook 2019 Display the output of a seach in a new Window Outlook VBA and Custom Forms 6
Albert McCann Outlook 2021 Outlook Display of HTML Email from two senders is glitchy Using Outlook 0
K Outlook 365 After migrating to Outlook 365, some contacts display in emails with prefixes Using Outlook 0
K Daily Task List Minimized Cannot Display Using Outlook 5
J images on note field display fraction of size Using Outlook 5
J Outlook 2016 Can't display some embedded HTML images in Outlook 2016 Using Outlook 2
O After filtering, how to display all events on that day? Using Outlook 4
M All fonts in Outlook emails display with exaggerated character spacing Using Outlook 4
G Schedule recurring email and attachments display Outlook VBA and Custom Forms 3
O Tasks - how to display "snoozed" tasks and snooze-times? Using Outlook 7
P Task display now leaves little room for notes Using Outlook 10
R Capture Sender's Display name and Address Outlook VBA and Custom Forms 3
M Outlook 2010 How could I globally redesign an outlook template form/region/inspector template used to display mail lists or an individual mails? Outlook VBA and Custom Forms 0
Travis Lloyd Messages Won't Display In Outlook 2019 Home & Business Using Outlook 0
A Prepending Email Addrs with "Display Name <email>" Has Stopped Working Using Outlook 0
M In Outlook Calendar remove the buttons: 'Today' and '<' (Back a day) and '>' (Forward a day) that are below the Ribbon and above the calendar display. Using Outlook 0
C Why won't Title display in message list? Using Outlook 1
R Auto display of new email does not work on non-default account Outlook VBA and Custom Forms 0
E How to display "Change Folder" in Change Default Email Delivery Location in Exchange Outlook 2016 Using Outlook 1
T Column to display which email alias a message was sent to Outlook VBA and Custom Forms 6
M Daily Task List Minimized Cannot Display Using Outlook 2
C Outlook Mobile app email order randomized and display names stripped Using Outlook 6
N Contact display as Using Outlook 2
J Reminders Display then Disappear Using Outlook 13
O How to display senders email address (column) Using Outlook 1
S Display PF contact folder items to select contact to link to appointment Outlook VBA and Custom Forms 1
I How to display sender's name instead of email address in outlook 2013 message Using Outlook 5
J Outlook 2016 message content does not display -; exchange Using accounts in Outlook 9
O Display more months in 'Tasks' Using Outlook 3
soadfan Outlook rules look up display name only Using Outlook 4
C Display Sender As Contact Outlook VBA and Custom Forms 4
O How to display folder icons? Using Outlook 2
Treebys Array out of bounds .display 2016 Outlook VBA and Custom Forms 3
copperberry How to display incomplete tasks due on or before 7 days from now Using Outlook 0
T outlook 2010 mail item count doesnt match display Outlook VBA and Custom Forms 3
Diane Poremsky Category Color doesn't Display in Inbox Using Outlook 0
P How to make outlook display alert appear on top of other windows whenever a new email is received? Outlook VBA and Custom Forms 1
T Outlook 2016 Calendar multiday event display Using Outlook 4
Diane Poremsky Display the Created Date field of any Outlook item Using Outlook 0
Diane Poremsky Replace Display Names with Email Addresses Using Outlook 0
Diane Poremsky Search for All Messages from Contact and Display in New Window Using Outlook 0
K Display sub-folders in body of outlook Using Outlook 1
O How to display multi-line task in To-Do List - Outlook 2010 Using Outlook 1
Diane Poremsky Display the Recipient Email Address in the Sent Items Folder Using Outlook 0
Diane Poremsky Excel Files Won't Display in Reading Pane Using Outlook 1
D Display of Open Folders Using Outlook 0
Fozzie Bear Change the Display Name recipients see for Exchange account Exchange Server Administration 0
Diane Poremsky Pictures don't display in Outlook messages Using Outlook 4
M Outlook VBA Macro that could retrieve/display the (From, Subject, Date Received) Outlook VBA and Custom Forms 2

Similar threads