January 1, 2012 at 12:00 am #6511MemberPoints: 0Rank: Member
by stevedolphin at 2013-02-05 04:50:46
I'm aware that it's very easy to use Get-MailboxStatistics to sum ItemCount and sizes and so on, but can anyone tell me how to do this selectively?
So an example here would be that I want to use e-mail item properties (fields) to selectively count. Imagine a scenario where I'm saying "okay, what's the item count in this persons mailbox where the "Follow Up Flag" is set, or what's the count of mail items that have an "Importance" flag.
Essentially I suppose I'm trying to make the equivalent of a search folder, but server side script, so the fields that I could use within Outlook to create a search folder based on e-mail fields I'd like to be able to "count" as part of a cmdlet.
Does that make sense? Can it be done?
by DonJ at 2013-02-05 08:14:38
It probably can, but once you start drilling into message-specific properties it goes beyond what the Exchange cmdlets can easily do. You'll have to crack open the mailbox, enumerate each item, check each property you're interested in, and so on. It'd be fairly time-consuming, I imagine. It could also be pretty high-impact when running on the server, especially against a large store.
by Takuu at 2013-02-06 06:19:16
You might want to try an Outlook VBA forum and look into it that way.
This can get you started on getting all the items. You will have to add a couple counters and an array to mark the items you want I'd imagine.
Static fldr As Outlook.Folder
Static inbox As Outlook.Folder
Dim inboxItems As Items
Dim customfolderItems As Items
Dim item As Outlook.MailItem
Set fldr = Outlook.Application.Session.GetDefaultFolder(olFolderInbox).Folders("custom fodler name")
Set inbox = Outlook.Application.Session.GetDefaultFolder(olFolderInbox)
Set customfolderItems = fldr.Items
Set inboxItems = inbox.Items
For Each item In customfolderItems
###do ur search stuff here####
Just a suggestion and hope it helps.
by stevedolphin at 2013-02-13 04:53:25
Thanks Takuu but that looks like it's limited to just a single session of Outlook whereas I'm trying to capture this at an Exchange Mailbox level.
The topic ‘Selective ItemCount’ is closed to new replies.