我写了一些 powershell,它检查一堆用户邮箱,并使用 Mapitable 检查特定属性。但是我还需要计算 UserProperties,并且我正在努力与 MapiTable 一起执行此操作 - 理想情况下,我希望它是“从 blah 中选择 blah,其中 userproperties.count = 4 并且 crmregardingID 不为空”
这是代码片段:
$sSqlQuery = 'Select Subject, senderName, MessageClass, ReceivedTime From $oFolName where "http://schemas.microsoft.com/mapi/string/{00020329-0000-0000-C000-000000000046}/crmRegardingId" IS NOT NULL'
$CurrFold = $RSession.GetFolderFromID($oDefFolder.EntryID)
$RTable.Item = $CurrFold.Items
$RecordSet = $RTable.ExecSQL($sSQLQuery)
if($recordset.recordcount -gt 0){
write-host "running loop"
Do STUFF
$recordset.Movenext()} until
($Recordset.EOF -eq $true )
$recordset.close()
$RSession.Logoff()
}
非常感谢所有帮助:)