I have a report that comes with a particular subject via email to my mailbox. I need to write a script that will pull out the attachments and then put those files in a folder on the system so that other scripts can pick it up and use the files. My exchange version is 2007. I am very new to PowerShell scripting. Please help.
Exchange doesn’t really offer a means of doing that server side. You could potentially script against the Outlook COM object on your client, but that does get pretty complex pretty quickly.
I am using the Outlook com object
You can try something like this:
$GetMailItems = @(
$OutlookInbox = 6
$Outlook = New-Object -Com Outlook.Application;
$NameSpace = $Outlook.GetNameSpace("MAPI");
$Inbox = $NameSpace.GetDefaultFolder($OutlookInbox))
$Inbox.Items | ForEach {
If ($_.Subject -eq "subject goes here")
{
Put your code to save to folder
}}
Like Don said it does get complex