Can't use EWS UpdateItem operation from Outlook add-in - exchangewebservices

I'm am trying to update a dictionary element in the IPM.Configuration.OWA.UserOptions message using an UpdateItem via an EWS (SOAP) request from an Outlook web add-in with ReadWriteMailbox permissions. However it is failing with the following error in the response:
ErrorAccessDenied: Office extension is not allowed to update this type of item.
The UpdateItem request I'm using is a fairly straightforward example of updating a message by it's ID and setting the value of an extended property:
<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:m="http://schemas.microsoft.com/exchange/services/2006/messages" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:t="http://schemas.microsoft.com/exchange/services/2006/types">
<soap:Header>
<RequestServerVersion Version="Exchange2013" xmlns="http://schemas.microsoft.com/exchange/services/2006/types" soap:mustUnderstand="0" />
</soap:Header>
<soap:Body>
<m:UpdateItem MessageDisposition="SaveOnly" ConflictResolution="AlwaysOverwrite">
<m:ItemChanges>
<t:ItemChange>
<t:ItemId Id="AAMkAGM0YTZmNjhiLTI0OWYtNGFlNC05ODAzLTNlZWQyODhmOTY2MABGAAAAAACxU7lpjO+oS5hB0UfA6muFBwDcAGmTk49MRrSCdR7rvVFPAAAAAAEBAADcAGmTk49MRrSCdR7rvVFPAAD2pXuVAAA=" ChangeKey="CQAAABYAAADcAGmTk49MRrSCdR7rvVFPAAD2uhNb" />
<t:Updates>
<t:SetItemField>
<t:ExtendedFieldURI PropertyTag="0x7c07" PropertyType="Binary" />
<t:Message>
<t:ExtendedProperty>
<t:ExtendedFieldURI PropertyTag="0x7c07" PropertyType="Binary" />
<t:Value>PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4NCjxVc2VyQ29uZmlndXJhdGlvbj4NCgk8SW5mbyB2ZXJzaW9uPSJFeGNoYW5nZS4xMiIgLz4NCgk8RGF0YT4NCgkJPGUgaz0iMTgtSXNGb2N1c2VkSW5ib3h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BRVBBQUE9IiAvPg0KCQk8ZSBrPSIxOC1Jc09wdGltaXplZEZvckFjY2Vzc2liaWxpdHkiIHY9IjMtRmFsc2UiIC8+DQoJCTxlIGs9IjE4LUlzRm9jdXNlZEluYm94RW5hYmxlZCIgdj0iMy1UcnVlIiAvPg0KCQk8ZSBrPSIxOC1OZXdFbmFibGVkUG9udHMiIHY9IjktMjE0NzQwMTcyNyIgLz4NCgkJPGUgaz0iMTgtc2lnbmF0dXJlaHRtbCIgdj0iMTgtJmx0O2h0bWwmZ3Q7JiN4RDsmI3hBOyZsdDtoZWFkJmd0OyYjeEQ7JiN4QTsmbHQ7L2hlYWQmZ3Q7JiN4RDsmI3hBOyZsdDtib2R5Jmd0OyYjeEQ7JiN4QTsmbHQ7cCZndDsmYW1wO25ic3A7Jmx0Oy9wJmd0OyYjeEQ7JiN4QTsmbHQ7cCZndDstLSZsdDsvcCZndDsmI3hEOyYjeEE7Jmx0O3AmZ3Q7SXp6eiBhbSBKYW5pY2smbHQ7L3AmZ3Q7JiN4RDsmI3hBOyZsdDtwJmd0OyZhbXA7bmJzcDsmbHQ7L3AmZ3Q7JiN4RDsmI3hBOyZsdDsvYm9keSZndDsmI3hEOyYjeEE7Jmx0Oy9odG1sJmd0OyYjeEQ7JiN4QTsiIC8+DQoJPC9EYXRhPg0KPC9Vc2VyQ29uZmlndXJhdGlvbj4=</t:Value>
</t:ExtendedProperty>
</t:Message>
</t:SetItemField>
</t:Updates>
</t:ItemChange>
</m:ItemChanges>
</m:UpdateItem>
</soap:Body>
</soap:Envelope>
The 0x7c07 property I'm updating in the UserOptions message contains a base64 encoded value of various signature related dictionary properties that I've modified:
<?xml version="1.0" encoding="utf-8"?>
<UserConfiguration>
<Info version="Exchange.12" />
<Data>
<e k="18-IsFocusedInboxOnLastUpdateTime" v="18-01/01/0001 00:00:00" />
<e k="18-autoaddsignature" v="3-True" />
<e k="18-UserOptionsMigrationState" v="9-5" />
<e k="18-themeStorageId" v="18-" />
<e k="18-autoaddsignatureonreply" v="3-True" />
<e k="18-timezone" v="18-Central Standard Time" />
<e k="18-signaturetext" v="18-
--
Izzz am Janick
" />
<e k="18-FavoriteFolders" v="1-18-3-120-AAMkAGM0YTZmNjhiLTI0OWYtNGFlNC05ODAzLTNlZWQyODhmOTY2MAAuAAAAAACxU7lpjO+oS5hB0UfA6muFAQDcAGmTk49MRrSCdR7rvVFPAAAAAAEMAAA=-120-AAMkAGM0YTZmNjhiLTI0OWYtNGFlNC05ODAzLTNlZWQyODhmOTY2MAAuAAAAAACxU7lpjO+oS5hB0UfA6muFAQDcAGmTk49MRrSCdR7rvVFPAAAAAAEJAAA=-120-AAMkAGM0YTZmNjhiLTI0OWYtNGFlNC05ODAzLTNlZWQyODhmOTY2MAAuAAAAAACxU7lpjO+oS5hB0UfA6muFAQDcAGmTk49MRrSCdR7rvVFPAAAAAAEPAAA=" />
<e k="18-IsOptimizedForAccessibility" v="3-False" />
<e k="18-IsFocusedInboxEnabled" v="3-True" />
<e k="18-NewEnabledPonts" v="9-2147401727" />
<e k="18-signaturehtml" v="18-<html><head></head><body><p>&nbsp;</p><p>--</p><p>John Doe</p><p>&nbsp;</p></body></html>;" />
</Data>
</UserConfiguration>
I can't find any documentation that states what is allowed or not allowed with UpdateItem operations (the list should be here). Updating the Outlook Online signature is also not currently possible with Graph or the Mail API. If what I'm trying to do ultimately cannot work then I just wasted 40+ hours of effort and will lose a client. :-|
Does anybody have any clever workarounds or know of a way to enable this operation? Note that using the EWS Managed API in server-side code is not currently an option for this solution.

Outlook does not allow add-ins to create or update FAI messages by design. In general we don't allow modifications of OWA options (or any other “service-type”, internal, item/data) directly which is probably an internal data structure, subject to change and potentially break the add-in.
If your scenario specifically requires access to outlook's signature system, I would recommend making a request to UserVoice

Related

How to find GP Name from GP English Name in ADMX file

hi i am currently moving gpo's to intune. i have read all of microsoft's documentation but one thing they do not cover is how to derive the gp name (in admx file) from the gp english name (what you would see in gp edit console). For non custom ADMX they say you can use the csp console like the image below:
but i am wanting to move over gpos that use custom admx, such as google chrome. I can go into the gp edit console and see the "Action on startup" gpo for example in the following location: Google/Google Chrome - Default Settings (users can override)/Startup, Home page and New Tab page
but how do i associate that with a policy entry in the chrome.admx file? just by going through the file i see this entry that most closely resembles what I want to do but how can i be sure it is the right one?
<policy class="Both" displayName="$(string.RestoreOnStartup)" explainText="$(string.RestoreOnStartup_Explain)" key="Software\Policies\Google\Chrome" name="RestoreOnStartup" presentation="$(presentation.RestoreOnStartup)">
<parentCategory ref="Startup"/>
<supportedOn ref="SUPPORTED_WIN7"/>
<elements>
<enum id="RestoreOnStartup" valueName="RestoreOnStartup">
<item displayName="$(string.RestoreOnStartup_RestoreOnStartupIsNewTabPage)">
<value>
<decimal value="5"/>
</value>
</item>
<item displayName="$(string.RestoreOnStartup_RestoreOnStartupIsLastSession)">
<value>
<decimal value="1"/>
</value>
</item>
<item displayName="$(string.RestoreOnStartup_RestoreOnStartupIsURLs)">
<value>
<decimal value="4"/>
</value>
</item>
</enum>
</elements>
</policy>
If you download the chrome policy templates zip, go to windows\admx\en-us folder. There’s a chrome.adml that will contain all the string substitutions for the admx. Admx + locale adml = what you see in the Gp editor window.

How to exclude the drafts folder when creating a search folder?

Using the query below, I created a search folder under the root folder. It works, but it also includes emails from the drafts folder.
Is there a straightforward way to exclude the drafts folder when creating this search folder?
<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:m="http://schemas.microsoft.com/exchange/services/2006/messages"
xmlns:t="http://schemas.microsoft.com/exchange/services/2006/types"
xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Header>
<t:RequestServerVersion Version="Exchange2010" />
</soap:Header>
<soap:Body>
<m:CreateFolder>
<m:ParentFolderId>
<t:DistinguishedFolderId Id="searchfolders" />
</m:ParentFolderId>
<m:Folders>
<t:SearchFolder>
<t:DisplayName> My_Search_Folder </t:DisplayName>
<t:PermissionSet>
<t:Permissions />
</t:PermissionSet>
<t:SearchParameters Traversal="Deep">
<t:Restriction>
<t:Contains ContainmentMode="FullString" ContainmentComparison="IgnoreCase">
<t:FieldURI FieldURI="item:Categories" />
<t:Constant Value="My_CATEGORY" />
</t:Contains>
</t:Restriction>
<t:BaseFolderIds>
<t:DistinguishedFolderId Id="root" />
</t:BaseFolderIds>
</t:SearchParameters>
</t:SearchFolder>
</m:Folders>
</m:CreateFolder>
</soap:Body>
</soap:Envelope>
You can't have a Folder Exception with a Search filter in EWS as all restrictions are Item based. So instead of Starting the Search at the root add each Subfolder into you SearchFolder defination Eg Inbox,SentItems etc instead.
The other option is add a Restriction that will exclude any messages that is currently Unsent by using a BitMask exclude https://msdn.microsoft.com/en-us/library/office/dd633708(v=exchg.80).aspx on the PR_MessageFlags property https://msdn.microsoft.com/en-us/library/cc839733(v=office.12).aspx eg
<m:Restriction>
<t:Excludes>
<t:ExtendedFieldURI PropertyTag="3591" PropertyType="Integer" />
<t:Bitmask Value="8" />
</t:Excludes>
</m:Restriction>
This won't exclude messages in the Drafts folder but will exclude any message in any folder that has the Bitwise MSGFLAG_UNSENT set in the PR_MessageFlags property.

Namespace doesn't show in web service

I have a WCF-Custom Transport Type Receive Location in BizTalk and the URI goes like https://productionenv.com/TPService/WcfService_TP_Orchestrations.svc.
The Binding Type is wsHttpBinding and Security Mode is Transport. And in serviceMetadata the httpsGetEnabled is set True.
However when I open its corresponding web service in IE, the expected namespaces which I've created does not show like below:
<sp:TransportBinding xmlns:sp="http://schemas.xmlsoap.org/ws/2005/07/securitypolicy">
<wsp:Policy>
<sp:TransportToken>
<wsp:Policy>
<sp:HttpsToken RequireClientCertificate="false" />
</wsp:Policy>
</sp:TransportToken>
<sp:AlgorithmSuite>
<wsp:Policy>
<sp:Basic256 />
</wsp:Policy>
</sp:AlgorithmSuite>
<sp:Layout>
<wsp:Policy>
<sp:Strict />
</wsp:Policy>
</sp:Layout>
</wsp:Policy>
</sp:TransportBinding>
<wsaw:UsingAddressing />
</wsp:All>
</wsp:ExactlyOne>
</wsp:Policy>
<wsdl:import namespace="http://www.microsoft.com/biztalk/2006/r2/wcf-adapter" location="https://productionenv.com/TPService/WcfService_TP_Orchestrations.svc?wsdl=wsdl0" />
Perhaps is there anything I missed in web.config part or the WCF-Custom Receive Loc itself that causes this issue?

How do I get autocompletion for Flex Metadata?

I took a look at flex metadata and it seems to be quiet straight forward. Though I have a problem, I don't get autocompletion for the metadata.
I'll tell you what I did, maybe you find an error. I want to create my own Style metadata tag named e.g. MyStyle. I want to create my own because it's easier for me to determine at runtime if the metadata was added by me or by the flex framework (therefore I will not use the predefined Style metadata tag).
To add metadata is pretty simple, I just wrote this code to get it work:
<s:Group xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark"
width="1024" height="768">
<fx:Metadata>
[MyStyle(required="true")]
</fx:Metadata>
</s:Group>
On my WindowedApplication component I added an added to stage listener to the stage. So all elements that are added to the application will fire that Event.ADDED when they are added to the stage. In that eventHandler I scan added elements for my metadata tag.
protected function addedToStageListener(event:Event):void
{
var classInfo:XML = describeType(event.target);
for each (var x:XML in classInfo..metadata)
{
if (x.#name == "MyStyle")
trace(x);
}
}
I also added a flex-config.xml file (in the toplevel of my src folder) to add the compiler options, so that I can read my custom metadata tag on runtime. The file looks like this:
<?xml version="1.0" encoding="UTF-8"?>
<flex-config>
<compiler>
<keep-as3-metadata>
<name>MyStyle</name>
</keep-as3-metadata>
</compiler>
</flex-config>
When I run this, I get the result I expect
<metadata name="MyStyle">
<arg key="required" value="true"/>
</metadata>
So this works. My next step was to add autocompletion when adding the metadata tag to the code. To do this you should create a metadata.xml which specifies the metadata tags right?
So I did this and I ended up with this simple metadata.xml
<?xml version="1.0" encoding="UTF-8"?>
<annotations version="2.1.1">
<metadata name="MyStyle" description="Adds style.">
<context name="class" />
<attribute name="required" type="Boolean" required="true" />
</metadata>
</annotations>
To add the metadata.xml correctly to the project I followed that tutorial by Adobe, but it doesn't work. I don't get autocompletion. Do you have any suggestions?
Update: I use Flash Builder 4.6 Professional and I created a Flex Library Project.

application-context.xml problem for Spring ActionScript

content of The application-content.xml is
<?xml version="1.0" encoding="utf-8"?>
<objects xmlns="http://www.springactionscript.org/schema/objects"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springactionscript.org/schema/objects
http://www.springactionscript.org/schema/objects/spring-actionscript-objects-1.0.xsd">
<property file="strings.properties" />
<object id="string1" class="String"/>
<object id="string2" class="String"/>
<object id="nlslzf" class="com.sgb.model.MyClass"/>
</objects>
content of strings.properties is:
s1=Firststring
s2=Secondstring
but error:
Main Thread (Suspended: Error: An object definition for 'string1' was not found.)
org.springextensions.actionscript.ioc.factory.support::AbstractObjectFactory/getObject
SpringActionScript/test
SpringActionScript/onCreationComplete
SpringActionScript/___SpringActionScript_Application1_creationComplete
flash.events::EventDispatcher/dispatchEventFunction [no source]
mx.core::UIComponent/dispatchEvent
mx.core::UIComponent/set initialized
mx.managers::LayoutManager/doPhasedInstantiation
Function/http://adobe.com/AS3/2006/builtin::apply [no source]
mx.core::UIComponent/callLaterDispatcher2
mx.core::UIComponent/callLaterDispatcher2
mx.core::UIComponent/callLaterDispatcher
i can run normal if removed the ''
why it is? springactionscript bug?
This does indeed 'smell' like a Spring Actionscript bug.
Please file a bug report for this in our JIRA system:
SpringAS JIRA
If you can, add a sample project that demonstrates the bug, that way we'll be able to track down the issue easier and faster.