Solved

How can I count the number of messages in the EOP quarantine

Posted on 2014-10-23
3
477 Views
Last Modified: 2014-10-24
I need to count how many messages are in the EOP quarantine. using "Get-QuarantineMessage | Measure" is no good because I hit the limits imposed by Microsoft. I'm sure the number if in the hundreds of thousands, much higher than the pagesize parameter will allow.

So, is there a command or script I can run that will return the number of messages quarantined?

Thank you
0
Comment
Question by:cyberleo2000
  • 2
3 Comments
 
LVL 39

Accepted Solution

by:
Vasil Michev (MVP) earned 250 total points
ID: 40400135
If you have that many, you will have to aggregate the results using the Page and PageSize parameters. Something like this:

$Messages = $null  
$Page = 1  
do  
{  
    $CurrMessages = Get-QuarantineMessage -PageSize 5000 -Page $Page
    $Page++  
    $Messages += $CurrMessages  
}  
until ($CurrMessages -eq $null)  

Open in new window



Shamelessly stolen from Alan Byrne's example here: https://gallery.technet.microsoft.com:443/office/Office-365-Mail-Traffic-afa37da1
0
 
LVL 16

Assisted Solution

by:Joshua Grantom
Joshua Grantom earned 250 total points
ID: 40400155
May take a while depending on how many there are...

Vasil's looks much better lol

$i = 0
Get-QuarantineMessage | % { $i = $i + 1}
Write-Host "Number of Messages in Quarantine: $i"

Open in new window

0
 
LVL 16

Expert Comment

by:Joshua Grantom
ID: 40400170
I used the below to test because I dont have exchange but it returned the value 29,300 in less than 20 seconds.

$i = 0
Get-ADComputer -filter * | % { $i = $i+1}
Write-Host $i

Open in new window

0

Featured Post

NAS Cloud Backup Strategies

This article explains backup scenarios when using network storage. We review the so-called “3-2-1 strategy” and summarize the methods you can use to send NAS data to the cloud

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

MS Outlook is a world-class email client application that is mainly used for e-communication globally.  In this article, we will discuss the basic idea about MS Outlook, its advanced features, and types of MS Outlook File formats.
This article lists the top 5 free OST to PST Converter Tools. These tools save a lot of time for users when they want to convert OST to PST after their exchange server is no longer available or some other critical issue with exchange server or impor…
To add imagery to an HTML email signature, you have two options available to you. You can either add a logo/image by embedding it directly into the signature or hosting it externally and linking to it. The vast majority of email clients display l…
how to add IIS SMTP to handle application/Scanner relays into office 365.

895 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now