从Exchange Server下载带有Powershell的电子邮件附件 [英] download Email Attachements with Powershell from Exchange Server

查看:58
本文介绍了从Exchange Server下载带有Powershell的电子邮件附件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


我正在编写一个PowerShell脚本,该脚本将每周运行一次,以转到我们的Exchange服务器上的特定邮箱。它的工作是找到最新的电子邮件并下载其附件。我一直在互联网上搜索一个很好的方法来做到这一点,但我找到的所有
都是访问本地outlook文件的方法,或者是为我购买的产品。我宁愿不买任何东西或使用EWS。请有人帮帮我。

I am writing a powershell script that will be run weekly to go to a particular mailbox on our exchange server. Its job is to find the latest email and download its Attachment. I have been all over the internet searching for a good way to do this, but all I have found are ways to access local outlook files or a product to buy that does it for me. I would prefer not to buy anything or use EWS. Could someone please help me out.

我们的服务器是win 2008 exchange 2010.再次,我希望通过powershell从我们的Exchange服务器上的邮箱中获取最新电子邮件中的附件。任何帮助将不胜感激。谢谢。

Our servers are win 2008 exchange 2010. Again I want to get an attachment out of the latest email in a mailbox on our exchange server through powershell. Any help would be greatly appreciated. Thank you.

推荐答案

您可以非常轻松地使用EWS托管API执行此操作,例如
http://gsexdev.blogspot.com.au/2010/01/writing-simple-scripted -process-to.html

如果您只想要最后收到的带有附件的电子邮件,您可以这样做

If you just want the last received email with an attachment you can do

## Load Managed API dll
Add-Type -Path "C:\Program Files\Microsoft\Exchange\Web Services\1.1\Microsoft.Exchange.WebServices.dll"

## Set Exchange Version


ExchangeVersion = [Microsoft.Exchange.WebServices.Data.ExchangeVersion] :: Exchange2010_SP1

##创建Exchange服务对象
ExchangeVersion = [Microsoft.Exchange.WebServices.Data.ExchangeVersion]::Exchange2010_SP1 ## Create Exchange Service Object


service = New-Object Microsoft.Exchange.WebServices.Data.ExchangeService(
service = New-Object Microsoft.Exchange.WebServices.Data.ExchangeService(


这篇关于从Exchange Server下载带有Powershell的电子邮件附件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆