Solved

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

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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

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

Lotus Notes – formerly IBM Notes – is an email client application, while IBM Domino (earlier Lotus Domino) is an email server. The client possesses a set of features that are even more advanced as compared to that of Outlook. Likewise, IBM Domino is…
Cloud-based technologies and services will continue to grow in popularity in 2017 thanks to the simple, scalable and cost-effective solutions they deliver. Here are three areas where cloud adoption is poised to really take off.
This video discusses moving either the default database or any database to a new volume.
This video demonstrates how to sync Microsoft Exchange Public Folders with smartphones using CodeTwo Exchange Sync and Exchange ActiveSync. To learn more about CodeTwo Exchange Sync and download the free trial, go to: http://www.codetwo.com/excha…

803 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