Powershell 数据挖掘outlook电子邮件正文

Powershell 数据挖掘outlook电子邮件正文,powershell,outlook,Powershell,Outlook,不久前,我经历并开始使用脚本guys get outlookInbox,它对数据挖掘主题非常有效,然而,我现在尝试基本上做同样的事情,但尝试用身体来做 最初,我从脚本人员导入自定义脚本: 使用该行 $inbox | Where-Object { $_.subject -match 'x'} | Where-Object { ($_.ReceivedTime -gt "06 11 2017") -and ($_.ReceivedTime -lt "10 10 2018") } | Group-Ob

不久前,我经历并开始使用脚本guys get outlookInbox,它对数据挖掘主题非常有效,然而,我现在尝试基本上做同样的事情,但尝试用身体来做

最初,我从脚本人员导入自定义脚本:

使用该行

$inbox | Where-Object { $_.subject -match 'x'} | Where-Object { ($_.ReceivedTime -gt "06 11 2017") -and ($_.ReceivedTime -lt "10 10 2018") } | Group-Object -Property senderName -NoElement | Sort-Object count

我已经尝试将
$\uuu0.subject
更改为
$\u0.body
,但是原始脚本似乎没有提取正文内容,我有点被困在这里,希望有人能给我指出正确的方向

无法使用的原因是原始脚本没有选择正文。为了获得消息的正文,您需要更改原始脚本以包含正文

更改:

Get-OutlookInbox.ps1

将行更改为:

$folder.items | Select-Object -Property Subject, ReceivedTime, Importance, SenderName
致:


返回调用带有“1”参数的“GetNamespace”时出现的错误异常:“无法将类型为“Microsoft.Office.Interop.Outlook.ApplicationClass”的COM对象强制转换为接口类型“Microsoft.Office.Interop.Outlook.\u应用程序”。此操作失败,因为对具有IID的接口的COM组件的QueryInterface调用”{00063001-0000-0000-C000-0000000000 46}'由于以下错误而失败:RPC服务器不可用。(HRESULT的异常:0x800706BA)。“如果您以管理员身份运行powershell,请确保您也以管理员身份运行outlook。
$folder.items | Select-Object -Property Subject, ReceivedTime, Importance, SenderName, body