如何检查通过PowerShell的Exchange邮箱?邮箱、PowerShell、Exchange

由网友(孤以无人也不念他)分享简介:我会如何使用PowerShell来返回最后5消息的文本和标题收到我的Exchange电子邮件帐户?有一个简单的方法/库来做到这一点?How would I go about using powershell to return the text and headers of the last 5 messages r...

我会如何使用PowerShell来返回最后5消息的文本和标题收到我的Exchange电子邮件帐户?有一个简单的方法/库来做到这一点?

How would I go about using powershell to return the text and headers of the last 5 messages received to my exchange email account? Is there a simple way/library to do this?

这是关系到有关未使用Outlook上的超级用户我的问题。除了使用具有找不到什么好的办法我想我还不如写我自己的简单的PowerShell客户端。

This is related to my question about not using outlook on superuser. Except that having not found any good alternatives I figure I might as well write my own simple powershell client.

推荐答案

您需要具备的 EWS API 的安装,你就需要检查路径的反思大会负荷部分的DLL。

You'll need to have the EWS API installed, and you'll need to check the path to the DLL in the Reflection Assembly load portion.

这应该让你的地方你能使用$ inbox.FindItems(5)语句工作,筛选你想出来的结果的地步。

This should get you to the point where you're able to work with the $inbox.FindItems(5) statement and filter the results you want out of that.

[Reflection.Assembly]::LoadFile("C:Program FilesMicrosoftExchangeWeb Services1.0Microsoft.Exchange.WebServices.dll")
$s = New-Object Microsoft.Exchange.WebServices.Data.ExchangeService([Microsoft.Exchange.WebServices.Data.ExchangeVersion]::Exchange2007_SP1)
$s.Credentials = New-Object Net.NetworkCredential('user', 'pass', 'domain')
$s.AutodiscoverUrl("email@address.com")

$inbox = [Microsoft.Exchange.WebServices.Data.Folder]::Bind($s,[Microsoft.Exchange.WebServices.Data.WellKnownFolderName]::Inbox)
$inbox.FindItems(5)
阅读全文

相关推荐

最新文章