title: Powershell: How to get file extensions of public folder attachments
body: <p>i wonder if there is a way to get the file extension from a public folder attachment?</p>
  
  <p><strong>Backgroud:</strong>
  We are using a software (AttachmentsProcessor) which extracts all attachments from the e-mails in the public folder structure and save it to the filesystem. The software puts a .lnk in the e-mail, which points to the location in the filesystem. So we can open the attachment by double-click.</p>
  
  <p>Lately we moved our public folder structure from internal Exchange to Office365 / Exchange Online. During this process we tried to put all extracted attachments back into the e-mails. After we done some tests, we noticed the this didn't work for some of the e-mails. We have still the .lnk as an attachment.</p>
  
  <p><strong>So what am I looking for?</strong>
  I would like to write a script in powershell which shows me a list of all e-mails and the corresponding folders (Identites), which have a .lnk file attached.</p>
  
  <p>On my search I just found something that works for mailboxes but nothing for public folders.</p>
  
  <p>-> Get-Mailbox | Export-Mailbox -AttachmentFilenames "*.PDF"</p>
  
  <p>-> Get-Mailbox | New-MailboxExportRequest -ContentFilter {Attachment -like "*.PDF"} </p>
  
  <p>Any help would be very nice. ;-)</p>
  
  <p>Thanks for your attention
  Peter</p>