Creating existing events by Exchange Web Services - exchange-server

I'm moving a business from Kerio Connect to MS Exchange 2010 (don't ask why). So I wrote some code that pulls events and tasks from Kerio by CalDAV and recreating them in Exchange by using EWS (Exchange Web Services).
Everything works fine except one thing: the link between the organizer and participants is broken. By that, I mean that a participant can edit the meeting, which he shouldn't be able to do, and if the organizer change the meeting time, participants don't get the update.
I have looked at what Outlook 2011 and iCal does when creating events, and I do the same steps, except for one important thing: the events I recreate in Exchange are events where participants already accepted invitations, and we don't want to send invitations when we start the migration.
This is the request to create the event in EWS:
<S:Envelope xmlns:S="http://schemas.xmlsoap.org/soap/envelope/">
<S:Header>
<ns2:MailboxCulture xmlns:ns2="http://schemas.microsoft.com/exchange/services/2006/types" xmlns:ns3="http://schemas.microsoft.com/exchange/services/2006/messages">en-US</ns2:MailboxCulture>
<ns2:RequestServerVersion xmlns:ns2="http://schemas.microsoft.com/exchange/services/2006/types" xmlns:ns3="http://schemas.microsoft.com/exchange/services/2006/messages" Version="Exchange2010_SP1" />
<ns2:TimeZoneContext xmlns:ns2="http://schemas.microsoft.com/exchange/services/2006/types" xmlns:ns3="http://schemas.microsoft.com/exchange/services/2006/messages">
<ns2:TimeZoneDefinition Id="Eastern Standard Time" />
</ns2:TimeZoneContext>
</S:Header>
<S:Body>
<ns3:CreateItem xmlns:ns2="http://schemas.microsoft.com/exchange/services/2006/types" xmlns:ns3="http://schemas.microsoft.com/exchange/services/2006/messages" SendMeetingInvitations="SendToAllAndSaveCopy">
<ns3:SavedItemFolderId>
<ns2:FolderId Id="AAMkADZkZDFkMjcwLTM5YWItNGRiYy05YzA0LWZhZmM3MjBkNDM1ZgAuAAAAAAAQdcJHRof+QosJDrhZyY00AQCw+XICdccgRJNrvNFaYvpgAAAAevvIAAA=" />
</ns3:SavedItemFolderId>
<ns3:Items>
<ns2:CalendarItem>
<ns2:Subject>Test prob -> probert</ns2:Subject>
<ns2:Body BodyType="Text">
</ns2:Body>
<ns2:Importance>Normal</ns2:Importance>
<ns2:UID>3CB0FF7D-63F0-47A0-80B6-3B3131E7BCF4</ns2:UID>
<ns2:Start>2012-12-21T17:00:00</ns2:Start>
<ns2:End>2012-12-21T18:30:00</ns2:End>
<ns2:IsAllDayEvent>false</ns2:IsAllDayEvent>
<ns2:Location>salle3219_6</ns2:Location>
<ns2:RequiredAttendees>
<ns2:Attendee>
<ns2:Mailbox>
<ns2:Name>Pascal Robert</ns2:Name>
<ns2:EmailAddress>probert#mydomain.com</ns2:EmailAddress>
</ns2:Mailbox>
<ns2:ResponseType>Accept</ns2:ResponseType>
</ns2:Attendee>
</ns2:RequiredAttendees>
<ns2:OptionalAttendees>
<ns2:Attendee>
<ns2:Mailbox>
<ns2:Name>salle3219_6</ns2:Name>
<ns2:EmailAddress>salle3219_6#mydomain.com</ns2:EmailAddress>
</ns2:Mailbox>
<ns2:ResponseType>Accept</ns2:ResponseType>
</ns2:Attendee>
</ns2:OptionalAttendees>
</ns2:CalendarItem>
</ns3:Items>
</ns3:CreateItem>
</S:Body>

Related

Dynamics 2016 email tracking ignoring outgoing replies

We have server-side synchronisation set up for our Dynamics 2016 on-premise instance, and it is correctly sending emails from a Case, and tracking replies from the customer. However, when an internal user replies using Outlook (without the CRM add in), their responses aren't being tracked. This means that the email conversation consists of an initial "outgoing" email, followed by only incoming responses.
The full scenario is:
Internal user sends an email from a CRM Case. Email tracked in CRM
Customer replies to email. Reply tracked in CRM and goes to internal user's Outlook
Internal user sends a reply from their Outlook. Reply is not tracked in CRM
Customer replies to email. Reply tracked in CRM and goes to internal user's Outlook
Is it possible to allow the Internal user's replies (point 3) to be tracked in CRM without installing the Outlook add in (i.e. so it also works from the Web/mobile versions of Outlook)?
I believe you cannot do this without Outlook client as per Jukka.
Without the CRM Outlook client you can’t get the information into CRM without copy-pasting it from one window to another in the aforementioned scenarios. No synchronization technology will help you here, since CRM is unaware of the item until it has been brought into its world. The “Track” button is a client-side feature that you can’t utilize with any server-side solution, which means there’s no way for a user to select an email, appointment, task or contact from the Exchange server that he or she would like to promote into a record in CRM. Since the the record wasn’t “born in CRM”, it just can’t find its way there.
Last resort would be Smart matching with Tracking token, which may help you in this scenario.
Update:
Customer reply is going to reach CRM through a monitored queue. You can read a lot & get clarity from the above link.
Deploying a solution like the CRM 2013 the server-side synchronization will take care of moving items like calendar appointments and contacts back and forth between the end-user client device and the central CRM database, but it only applies to items that already exist in the realm of CRM. What I mean by this is that the item was either originally created directly in the CRM application or it was received via a monitored location like an email queue.
Your expectation is right, it should be tracked. I would open a ticket with MS & solve this.
Once the item is in CRM, server-side sync can take care of tracking the subsequent updates to it. A re-scheduled tracked appointment will get updated with the new date, regardless of whether you change the date via CRM or your mobile phone calendar that’s linked to Exchange. An email thread with a tracked message and a tracking token ID injected into the email subject line will have the next replies automatically synchronized into CRM
I have heard back from our Microsoft Partner, and they say that this scenario isn't possible. By design, it'll only track incoming emails to CRM, or outgoing if sent from within CRM itself.

Is there an event for an event starting/ending in Exchange 2013?

I want to integrate a presence management system (in which users show their status such as "In a Meeting", "At Lunch", "Working on Project", etc) with our Exchange 2013 server.
Is there a way in which I can subscribe and receive an event (API), not of when an event (meeting, etc) is added or removed from a calendar but of when exactly the event (meeting) in the calendar starts and ends?
In other words, what I want to accomplish is that when a user has a meeting that's in their Exchange calendar I listen to that event and automatically change their status in their presence management system.
The best way seamed to be to check the free/busy information (e.g. via Exchange Webservice = EWS).
As you aren´t much specify on your issue I think the best starting point is:
How to: Get free/busy information by using EWS in Exchange

Add-ins do not show up under 'Admin Managed' after deploying them to the Office 365 Admin Centre

After deploying a Word Add-in via centralised deployment, it doesn't show up in Word. We used this procedure to deploy the add-in and it lists it there succesfully.
Because we were worried it may be due to something wonky with our own plugin, we then decided to try to deploy the 'Contoso Citations' plugin which is used in the same procedure and screenshots here.
After capturing traffic whenever we press 'Update' under the Add-in Admin Managed dialog, we noticed a connection to Exchange. We then captured the traffic using a proxy and some root certificates, and we found the following call:
POST https://outlook.office365.com/ews/exchange.asmx
<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
<s:Header>
<RequestServerVersion Version="V2016_10_10" xmlns="http://schemas.microsoft.com/exchange/services/2006/types"/>
<MailboxCulture xmlns="http://schemas.microsoft.com/exchange/services/2006/types">en-US</MailboxCulture>
</s:Header>
<s:Body>
<GetPrivateCatalogAddIns xmlns="http://schemas.microsoft.com/exchange/services/2006/messages"><Client Code="Win32_Word" Version="16.0.0.0"/></GetPrivateCatalogAddIns>
</s:Body>
</s:Envelope>
Which seems to retrieve the catalog from Exchange. This for some reason seems to return a 500 with the following response:
<?xml version="1.0" encoding="utf-8"?>
<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
<s:Header>
<Action s:mustUnderstand="1" xmlns="http://schemas.microsoft.com/ws/2005/05/addressing/none">*</Action>
</s:Header>
<s:Body>
<s:Fault>
<faultcode xmlns:a="http://schemas.microsoft.com/exchange/services/2006/types">a:ErrorInternalServerError</faultcode>
<faultstring xml:lang="en-US">An internal server error occurred. The operation failed.</faultstring>
<detail>
<e:ResponseCode xmlns:e="http://schemas.microsoft.com/exchange/services/2006/errors">ErrorInternalServerError</e:ResponseCode>
<e:Message xmlns:e="http://schemas.microsoft.com/exchange/services/2006/errors">An internal server error occurred. The operation failed.</e:Message>
</detail>
</s:Fault>
</s:Body>
</s:Envelope>
However, no error dialog or so is shown. It just shows 'No add-ins currently available'. We are running different versions of Office 365 ProPlus (build 1704, 1703 and some others), but all seem to result in a 500 result code. We also have enabled OAuth authentication on our Exchange Mailboxes. Removing all our plugins from the Office 365 admin centre still results in 500's.
Does anybody know why Exchange may be throwing 500's at us, how we can work around this and still deploy the Add-in using the Office 365 Admin Centre?
Unfortunately, both deploying using SharePoint or Shared Folders is not a possibility and our Add-in shouldn't be deployed using the store.
can you delete the Add-In and re-add it? We had an issue earlier this week which is now resolved

Appointment changed by another person notification to organizer. How to turn it off?

We are making a web based solution with Exchange appointment synchronization throw EWS. After appointment created in our system it will be imported to exchange. Aappointment changes in our system are followed by Exchange appoinment updates. This operations are made with credentials of application pool. For some instalations updates in Exchange appointment will be followed by email for organizer. This email informes orginizer about changes in his appointment that were made not by him. Other instalations don't send such a mail. We need to tell Exchange "hey! don't send notification to orginizer!". How can we do it?
When you send the update, you need to set the SendInvitationsOrCancellationsMode to SendtoNone:
ewsAppt.Update(ConflictResolutionMode.AlwaysOverwrite, SendInvitationsOrCancellationsMode.SendToNone);

Find mailbox delegates with Exchange Web Services (EWS)

I'm currently developing an EWS client application under iOS, so I'm using the Exchange Web Services for communicating with the Exchange 2010 server (plain XML as opposed to the managed API).
I am aware how to access the mailbox and calendar of a delegate and grant or delete delegate access to a mailbox, but before accessing I need to find these mailboxes first. That is, I want to find all mailboxes which my current user has access to (as opposed to all users who have access to the current mailbox, which is well-documented).
This question from 2011 (EWS API Delegate List) indicates that there is no possibility, but without providing any references. I have not found any resources and no hints in the documentation, but Outlook easily identifies these mailboxes. Maybe it is using some internal API, I was unable to find the corresponding requests in its communication with the server.
How can I find these mailboxes? Or is there still no way of achieving this, assuming the answer from 2011 was correct? If so, how does Outlook manage to do this?
There are a few ways in which you maybe granted access to another users Mailbox, one method is via Outlook Delegates which basically modifies the Folder Ace's and also the FreeBusy object in the users Mailbox. The other method if the Admin Grants a somebody full access to a Mailbox using Add-MailboxPermission and then allows AutoMapping http://www.msexchange.org/articles-tutorials/exchange-server-2010/management-administration/mailbox-auto-mapping-exchange-server-2010-part1.html of the Mailbox. This mean Outlook will automatically connect the Mailbox as an additional Mailbox.
So to find Mailboxes that your user will Automap you can use Autodiscover and the Mailbox will be returned in the AdditionalMailboxes eg
<?xml version="1.0" encoding="utf-8" ?>
<soap:Envelope xmlns:a="http://schemas.microsoft.com/exchange/2010/Autodiscove
r" xmlns:wsa="http://www.w3.org/2005/08/addressing" xmlns:xsi="http://www.w3.org
/2001/XMLSchema-instance" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Header>
<a:RequestedServerVersion>Exchange2010_SP2</a:RequestedServerVersion>
<wsa:Action>http://schemas.microsoft.com/exchange/2010/Autodiscover/Autodiscover/GetUserSettings</wsa:Action>
<wsa:To>https://autodiscover-s.outlook.com/autodiscover/autodiscover.svc</wsa:To>
</soap:Header>
<soap:Body>
<a:GetUserSettingsRequestMessage xmlns:a="http://schemas.microsoft.com/exchange/2010/Autodiscover">
<a:Request>
<a:Users>
<a:User>
<a:Mailbox>user#domain.com</a:Mailbox>
</a:User>
</a:Users>
<a:RequestedSettings>
<a:Setting>AlternateMailboxes</a:Setting>
</a:RequestedSettings>
</a:Request>
</a:GetUserSettingsRequestMessage>
</soap:Body>
</soap:Envelope>
For Outlook delegates its a little different story if some random user adds you as a delegate (and doesn't send you the summary) or let you know nothing will happen and Outlook won't show or know about this. However if you do know that somebody has delegated you access to their calendar for example and then you open that calendar in Outlook the first time you do this it will add a Wonderbar (Navigational) shortcut https://msdn.microsoft.com/en-us/library/ee202589(v=exchg.80).aspx that Outlook (and OWA) will then use in the future to show this calendar by default. You can make use of these Nav shortcuts in a mailbox by querying them in the CommonViews Folder eg EWS - Access All Shared Calendars . (note if you where using the new REST API in Office365 you can now do this natively in the API)

Resources