• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

Outlook 2016 How to display number of items per .pst file

ofw62

Senior Member
Outlook version
Outlook 2016 32 bit
Email Account
POP3
#1
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.

Thanks
 
Outlook version
Outlook 2010 64 bit
Email Account
Exchange Server
#2
Hi,

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

NAME
C:\Scripts\demo\Get-MailboxReport.ps1

SYNOPSIS
Get-MailboxReport.ps1 - Mailbox report generation script.

SYNTAX
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] []

DESCRIPTION
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.


REMARKS
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.

Cheers
Max
 
Outlook version
Outlook 2016 32 bit
Email Account
Office 365 Exchange
#3

ofw62

Senior Member
Outlook version
Outlook 2016 32 bit
Email Account
POP3
#4
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...)

-
 
Outlook version
Outlook 2016 32 bit
Email Account
Office 365 Exchange
#5
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.
 

ofw62

Senior Member
Outlook version
Outlook 2016 32 bit
Email Account
POP3
#6
Diane,
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)

-
 

ofw62

Senior Member
Outlook version
Outlook 2016 32 bit
Email Account
POP3
#7
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. blablaname-at-outlook.com (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
 
Outlook version
Outlook 2016 32 bit
Email Account
Office 365 Exchange
#8
Ah... yes, thanks for pointing that out. I'll update the article to make sure that is clear.