Link to home
Start Free TrialLog in
Avatar of SAM2009
SAM2009Flag for Canada

asked on

Is there a PowerShell cmd that can read Outlook email header? ?

Hi,

Is there a PowerShell cmd that can read Outlook email header?

I need to access header properties and find send IP.
Avatar of Kimputer
Kimputer

Probably, but it would take me too much time to figure it out. You can try it yourself by first reading up and trying to understand this:


https://devblogs.microsoft.com/scripting/learn-to-use-the-exchange-web-services-with-powershell/


When you get the hang of it, use this code to give you hints how to apply it to Powershell:


https://social.technet.microsoft.com/Forums/office/en-US/1e5bbde0-218e-466e-afcc-cb60bc2ba692/e2010-ews-c-how-to-get-the-actual-smtp-address-that-an-email-was-sent-to-internally?forum=exchangesvrdevelopment


It extracts the To: field, but in your case, you can simplify it and dump the whole header.


To get the real originating IP address is still very tricky though (if there are more MTA hops). If you are only interested in the last hop connecting to your Exchange server, maybe its doable.



Are you trying to access emails that reside in Outlook desktop, or O365 in the cloud?


»bp
Do you mean something like this: https://mha.azurewebsites.net/

but automated with Powershell script to go through your Desktop Outlook?
Avatar of SAM2009

ASKER

Yes get info like this:  https://mha.azurewebsites.net/

But this need to paste Email Header properties to the link. Is there a way by PowerShell? ... I doubt.
Avatar of SAM2009

ASKER

The fist one is similar to the link before but it's an Add-ON

The second it just the manual way to see the header.

None of them show us how to use PowerShell to automatize the process.
Are you trying to access emails that reside in Outlook desktop, or O365 in the cloud?

»bp
Avatar of SAM2009

ASKER

Outlook desktop
ASKER CERTIFIED SOLUTION
Avatar of Bill Prew
Bill Prew

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of SAM2009

ASKER

Thanks!