Reputation: 383
I am writing a script that uses the Exchange EWS API to save an attachment on a calendar to a file locally. When I do this on any user account, it works perfectly, however, when I attempt to use it on a shared resource account it fails.
I can reproduce this in Postman as well. Calling the GetItem request (see below) will return all the item data but the AttachmentId is not present on the resource account. The same request on my user account does return the AttachmentId. The HasAttachments field also shows False when called on the resource account.
Is there some property or value that I'm missing for the Resource account?
GetItem:
<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:t="http://schemas.microsoft.com/exchange/services/2006/types"
xmlns:m="http://schemas.microsoft.com/exchange/services/2006/messages">
<soap:Header>
<t:RequestServerVersion Version="Exchange2007_SP1" />
</soap:Header>
<soap:Body>
<m:GetItem>
<m:ItemShape>
<t:BaseShape>AllProperties</t:BaseShape>
<t:AdditionalProperties>
<t:FieldURI FieldURI="item:Attachments" />
<t:FieldURI FieldURI="item:HasAttachments" />
</t:AdditionalProperties>
</m:ItemShape>
<ItemIds>
<t:ItemId Id="AAAlAF..." ChangeKey="CQAAAB..." />
</ItemIds>
</m:GetItem>
</soap:Body>
</soap:Envelope>
EDIT: This is definitely an issue with the account itself as OWA doesn't show the attachment either. Can shared calendar accounts not accept attachments?
Upvotes: 0
Views: 279
Reputation: 22032
s there some property or value that I'm missing for the Resource account?
If this a Resource Mailbox that is Auto accepting meetings then the default configuration of the Mailbox is to delete attachments for security reasons.
"The DeleteAttachments parameter specifies whether to remove attachments from all incoming messages. Valid input for this parameter is $true or $false. The default value is $true. This parameter is used only on resource mailboxes where the AutomateProcessing parameter is set to AutoAccept."
re https://technet.microsoft.com/en-us/library/dd335046(v=exchg.160).aspx
Upvotes: 1