Read content of incoming mails through script

We are looking for a solution where a script monitors all incoming emails which contains URL and write the URL in a text file along with the sender & subject name.
Is it possible through powershell?
o365AdmAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Nadav SolomonCommented:
if you'll do it using outlook you will need to move the message/delete it or think of a way of not going over the same item you already did:
$olFolderInbox = 6
$outlook = new-object -com outlook.application;
$mapi = $outlook.GetNameSpace("MAPI");
$inbox = $mapi.GetDefaultFolder($olFolderInbox)
$inbox.items | %{
    $_.body
}

Open in new window


Another way is to use EWS managed API there you can sync folder items that will give you a serial after every run then on the next run you send this serial and get only new items since last run.

Enjoy.
1

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
o365AdmAuthor Commented:
We are ok to delete the message after reading from script. May I request for a script to achieve this requirement.
0
Nadav SolomonCommented:
Add $_.delete() ... In the loop
1
o365AdmAuthor Commented:
Many thanks for your help.
0
Nadav SolomonCommented:
Glad I could help, thanks for the feedback.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
VB Script

From novice to tech pro — start learning today.