问题
I have written some powershell, which checks a bunch of users mailboxes, and checks a specific property using a Mapitable. However I need to count the UserProperties also, and i'm struggling to do this in conjunction with the MapiTable - Ideally i'd like it to be "select blah from blah where userproperties.count = 4 AND crmregardingID IS NOT NULL"
Here's the snippet of code:
$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()
}
All help much appreciated :)
回答1:
User properties definitions are stored as a blob in a special named property. The only way to get the UserProperties collection is to open the message as RDOMail object; you cannot do that using ExwecSQL.
来源:https://stackoverflow.com/questions/16188105/redemption-outlook-mapitable-and-userproperties-q