我需要从Exchange 2003中的用户日历中提取所有非私有项目。我已经完成了以下工作,它会提取所有项目(包括私有字段):
<?xml version="1.0"?>
<g:searchrequest xmlns:g="DAV:" xmlns:mapi="http://schemas.microsoft.com/mapi/">
<g:sql>
SELECT "http://schemas.microsoft.com/mapi/Private", "urn:schemas:calendar:uid", "urn:schemas:calendar:location", "urn:schemas:httpmail:subject", "urn:schemas:calendar:dtstart", "urn:schemas:calendar:dtend", "urn:schemas:calendar:busystatus", "urn:schemas:calendar:meetingstatus", "urn:schemas:calendar:instancetype"
FROM Scope('SHALLOW TRAVERSAL OF "%s"')
WHERE NOT "urn:schemas:calendar:instancetype" = 1 AND "DAV:contentclass" = 'urn:content-classes:appointment' AND "urn:schemas:calendar:dtstart" > '2003/06/01 00:00:00' AND "mapiPrivate" = 0
ORDER BY "urn:schemas:calendar:dtstart" ASC
</g:sql>
</g:searchrequest>
但是,当我尝试将私有字段添加到WHERE
时,我收到BAD REQUEST
错误。以下代码是我如何将Private字段添加到WHERE
子句。
<?xml version="1.0"?>
<g:searchrequest xmlns:g="DAV:" xmlns:mapi="http://schemas.microsoft.com/mapi/">
<g:sql>
SELECT "http://schemas.microsoft.com/mapi/Private", "urn:schemas:calendar:uid", "urn:schemas:calendar:location", "urn:schemas:httpmail:subject", "urn:schemas:calendar:dtstart", "urn:schemas:calendar:dtend", "urn:schemas:calendar:busystatus", "urn:schemas:calendar:meetingstatus", "urn:schemas:calendar:instancetype"
FROM Scope('SHALLOW TRAVERSAL OF "%s"')
WHERE NOT "urn:schemas:calendar:instancetype" = 1 AND "DAV:contentclass" = 'urn:content-classes:appointment' AND "urn:schemas:calendar:dtstart" > '2003/06/01 00:00:00' AND "mapiPrivate" = 0 AND "http://schemas.microsoft.com/mapi/Private" = 0
ORDER BY "urn:schemas:calendar:dtstart" ASC
</g:sql>
</g:searchrequest>
我做错了什么?这不可能吗?
答案 0 :(得分:1)
您需要请求PR_SENSITIVITY属性(DASL名称http://schemas.microsoft.com/mapi/proptag/0x00360003)。 对于私人申请,其价值为SENSITIVITY_PRIVATE(= 2)