Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

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

Posted on 2014-10-23
3
521 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 40

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

Best Practices: Disaster Recovery Testing

Besides backup, any IT division should have a disaster recovery plan. You will find a few tips below relating to the development of such a plan and to what issues one should pay special attention in the course of backup planning.

Question has a verified solution.

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

Suggested Solutions

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.
The video tutorial explains the basics of the Exchange server Database Availability groups. The components of this video include: 1. Automatic Failover 2. Failover Clustering 3. Active Manager
This Experts Exchange video Micro Tutorial shows how to tell Microsoft Office that a word is NOT spelled correctly. Microsoft Office has a built-in, main dictionary that is shared by Office apps, including Excel, Outlook, PowerPoint, and Word. When …

839 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