2017-06-02 12 views
-1

您好我正在创建一个PowerShell脚本来阅读从我已经回复的Outlook的电子邮件。有人可以帮助我找出变量中的属性。 所有电子邮件都在$ monitor变量中。展望powershell回复电子邮件属性

Add-type -assembly “Microsoft.Office.Interop.Outlook” | out-null 

$olFolders = “Microsoft.Office.Interop.Outlook.olDefaultFolders” -as [type] 

$outlook = new-object -comobject outlook.application 

$namespace = $outlook.GetNameSpace(“MAPI”) 

$folder = $namespace.getDefaultFolder($olFolders::olFolderInBox) 

$Monitor = $folder.Folders.Item("Test") 

回答

0

https://stackoverflow.com/a/15323686/478656和评论在https://www.slipstick.com/developer/code-samples/forward-messages-not-replied/它看起来像你想

$Email.PropertyAccessor.GetProperty("http://schemas.microsoft.com/mapi/proptag/0x10810003") 

这是PR_LAST_VERB_EXECUTED财产,并输出为0(未回答),102( '答复')或103('全部回复')。

所以也许

$LastVerb = "http://schemas.microsoft.com/mapi/proptag/0x10810003" 
$Monitor.Items | Where-Object { $_.PropertyAccessor.GetProperty($LastVerb) -gt 0 } 
+1

它的工作由于一吨:) – Mandy