Forum Discussion

Begie1605's avatar
Begie1605
Copper Contributor
Nov 18, 2020

EXCHANGE-Online: powershell to get the number of mails in inbox not in a specific category

Hi All,

I have a specific question. I want via powershell get the number of mails in the inbox of a online shared mailbox that do not have a specific category....

 

Seems special request? Let me explain why i'm looking for it.

We have monitoring software that can execute powershells and get results of it.

I now want to monitor our dynamics 365 support mailbox to see if all mails are tranferred towards Dynamics365 correctly.

 

For this reason Dynamics 365 can read a specific mailbox inbox, to see if new mails have come in. When Dynamics 365 sees this, the mail gets "tracked" to Dynamics 365 and gets a category applied to it "Traced to Dynamics 365". In normal scenario, this works well, and mails get tracked etc....

 

Sometimes there are problems tracking. Sometime some mails are not tracked, sometimes the connector between Dynamics 365 and Exchange fails etc...

 

As we rely heavy on this mail traffic in our support department, this causes a problem if not cached.

 

So with this powershell i want to return a number, be it the number of mails without that category in the inbox. If this number gets too high.....then we have a problem and our monitor software can react and send alarms...

 

Any ideas would be appreciated..

 

Rgds

Benny Giebens

Resources