I am trying to get To, From, subject, sent date from about a 100 .msg files that are saved in a folder on my local drive, possibly get all that info in a csv using powershell.
I ran this code I got from another post
Get-ChildItem "C:\--------\msgfileshere" -Filter *.msg |
ForEach-Object{
$outlook = New-Object -comobject outlook.application
$msg = $outlook.CreateItemFromTemplate($_.FullName)
$msg | Select From,to,subject,Senton,Cc|ft -AutoSize
}
I am able to get Subject and Senton date.
But no other information comes out related to Sender, to, Cc. Am I missing something here?
Edit: I was able to get Sender info which gives System.__ComObject as the output but not the actual email address