powershell - 如何在 EWS 的最后一天收到消息?
问题描述
我正在 PowerShell 中编写一些脚本,我想从电子邮件中获取消息。我有一个 xml 可以从 EWS 获取所有消息,但我只想获取昨天的消息。谁能帮我做到这一点?
$getInbox= @"
<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:t="http://schemas.microsoft.com/exchange/services/2006/types">
<soap:Header>
<t:RequestServerVersion Version="Exchange2013_SP1"/>
</soap:Header>
<soap:Body>
<FindItem xmlns="http://schemas.microsoft.com/exchange/services/2006/messages"
xmlns:t="http://schemas.microsoft.com/exchange/services/2006/types"
Traversal="Shallow">
<ItemShape>
<t:BaseShape>IdOnly</t:BaseShape>
</ItemShape>
<ParentFolderIds>
<t:DistinguishedFolderId Id="inbox"/>
</ParentFolderIds>
<QueryString>HasAttachments:true From:myEmail Kind:email</QueryString>
</FindItem>
</soap:Body>
</soap:Envelope>"@
解决方案
您应该能够将收到的:昨天添加到您的查询字符串中,例如
<QueryString>HasAttachments:true From:myEmail Kind:email received:yesterday</QueryString>
推荐阅读
- android - Android改变开关状态的颜色
- c# - 在鼠标悬停时更改按钮的背景
- java - JFileChooser 的限制
- java - Java:打印到屏幕被延迟
- conv-neural-network - 在 CNN 的情况下,向 Softmax 函数添加偏差有什么好处?
- razor - 如何在asp.net核心中定义返回html的函数
- reactjs - webpack 解决冲突?我应该使用别名吗?
- node.js - 如何在我调用回调的承诺中捕获错误?
- c# - 带有绑定到列的子句的 LINQ 查询
- c# - 在 C# Winforms 中使用 MouseEvents 更改图表系列的外观