Link to home
Start Free TrialLog in
Avatar of Evolution-Recruitment
Evolution-Recruitment

asked on

Export Exchange emails to CSV and Download attachment in powershell

Hi,

Does anyone know how to
1. Export emails to csv via Powershell directly from exchange
2. Export the attachments to a folder via Powershell directly from exchange

I can do it on powershell through outlook but not directly via exchange. I could save a lot of money on licenses!

Here is the function I used to list emails via outlook

Function Get-Outlookinbox
{
 Add-type -assembly "Microsoft.Office.Interop.Outlook" | out-null
 $olFolders = "Microsoft.Office.Interop.Outlook.olDefaultFolders" -as [type] 
 $outlook = new-object -comobject outlook.application
 $namespace = $outlook.GetNameSpace("MAPI")
 $folder = $namespace.getDefaultFolder($olFolders::olFolderInBox)
 $folder.items | 
 Select-Object -Property Subject, ReceivedTime, Importance, SenderName
 }
Get-OutlookInBox

Open in new window


Thanks!
ASKER CERTIFIED SOLUTION
Avatar of Qlemo
Qlemo
Flag of Germany image

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