Exchange EWS Calendar title rewrite for room mailboxes - outlook

Our IT has provided me with a service account (ex-sa-devtest#mydomain.de) that has delegate rights to a room's mailbox (EX-Room-A#mydomain.de) and a user's mailbox (user.a#mydomain.de).
In Outlook, running as user.a, I created an event using EX-Room-A as room. Now here is the matrix what happens in Outlook Web Access and by using the EWS API FindItems (resp. GetItem):
using the credentials of user.a, I see the correct event details (Subject and Body) on the mailbox of user.a. When accessing the mailbox of ex-room-a, I get "ErrorFolderNotFound: The specified folder could not be found in the store."
Using the credentials of ex-sa-devtest on mailbox of ex-room-a, I see Subject="User A " (note the space at the end) and Body is empty. On mailbox of user.a, I see correct Subject and Body.
What causes the "rewrite" of the Subject field and the emptying of the Body field when the service account accesses the room mailbox?
The SOAP XML I use is:
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://schemas.microsoft.com/exchange/services/2006/types" xmlns:ns2="http://schemas.microsoft.com/exchange/services/2006/messages">
<SOAP-ENV:Header><ns1:RequestServerVersion Version="Exchange2013_SP1"/><ns1:TimeZoneContext><ns1:TimeZoneDefinition Id="W. Europe Standard Time"/></ns1:TimeZoneContext></SOAP-ENV:Header>
<SOAP-ENV:Body>
<ns2:FindItem>
<ns2:ItemShape><ns1:BaseShape>AllProperties</ns1:BaseShape></ns2:ItemShape>
<ns2:CalendarView StartDate="2017-12-06T00:00:00+01:00" EndDate="2017-12-06T23:59:59+01:00"/>
<ns2:ParentFolderIds>
<ns1:DistinguishedFolderId Id="calendar"><ns1:Mailbox><ns1:EmailAddress>ex-room-a#mydomain.de</ns1:EmailAddress></ns1:Mailbox></ns1:DistinguishedFolderId>
</ns2:ParentFolderIds>
</ns2:FindItem>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>

For security reason this information is removed by the Mailbox assistant as part of the Automatic Processing logic. You can configure this using the Set-CalendarProcessing cmdlet https://technet.microsoft.com/en-us/library/dd335046%28v=exchg.160%29.aspx eg
The DeleteSubject parameter specifies whether to remove or keep the subject of incoming meeting requests. 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.

Related

Microsoft Graph Security alert get internet message id

What I need:
Get access to the Internet Message Id for an email related incident via the Microsoft Graph Security API
My problem:
I used Outlook's reporting module and marked an email that was in my inbox as Phishing. This then created an event in https://security.microsoft.com. See the below image. Incident ID 16.
I put together a webhook that is able to pull alerts via the Microsoft Graph Security API. From this call I managed to retrieve the alert's ID. I then used that ID to get more information about the alert by using this call: (https://graph.microsoft.com/v1.0/security/alerts/{alert_id})
In the JSON body of the response there's a property called messageSecurityStates that is always empty. I found this link to Javadoc.io where the object's properties are described and it looks like this property should contain the Internet Message Id. But when querying the Microsoft Graph Security API, the object is always empty.
Question:
What do I need to do to ensure that my email related alerts that are queried via the MS Graph Security API have email related information such as Internet Message Id?

Logic Apps Email Trigger - Get original Alias

Found a very similar question here: Email aliases not returned as "To" address in logic app
TLDR: From within a logic app "When a new email arrives" trigger, How do I get the original alias that the email was sent to?
I have a logic app that creates a ticket based off an email sent to an outlook box. Now I want to be able to choose aspects of the ticket based off of whether or not the email was sent to the mailbox itself or an alias of the mailbox. The problem I'm having is that by the time logic apps gets a hold of the email, the alias address has already been replaced with the actual box's address ("alias1#place.com" -> "actualbox#place.com").
The actual mail in the inbox has the original email's alias information in the headers, but I can only get them by looking at the properties in outlook. I've tried to get the original "To" internetheader information both within logic apps (by exporting the email to blob storage and looking at headers there) and with the Microsoft Graph API. Sadly, the email exported by logic apps doesn't have the alias information and Graph API has pretty much every header but "To". At least one other person has lamented the lack of To
That said, the actual email still has the original alias information. Can someone help me get that information in logic apps without jumping through too many hoops? A many hoop solution is welcome if none other can be found though.
Use the Export email (V2) action from the Office 365 Outlook connector. This will give you the full message with original headers (including the actual To address)!
The flow here is, trigger on the incoming email, as you already are, then add the export email action providing the message id from that trigger to pull this specific email.
From there, you you'll have one big "body" property which you'll need to interrogate to find the To address.
Caveat on this though, it doesn't work when emails are sent between mailboxes in the same Office 365 tenant. Exchange Online will "helpfully" go, "I know that address... this is the address you wanted!"
What API are you using? In Outlook Object Model / MAPI / EWS, you need to retrieve the PR_TRANSPORT_MESSAGE_HEADERS MAPI property (DASL name http://schemas.microsoft.com/mapi/proptag/0x007D001F)
We arrived at a many hoop solution.
The "Primary" email box now has some rules that look at the internet headers mentioned above (Message -> Properties -> look for 'To:').
If it finds an alias there, it will put the email in a corresponding folder for each alias.
Then we have logic apps listening to each of the alias folders which will then send the email's information to the _Core logic app that does the actual processing.

EWS Calendar Attendees

I am working with the Exchange Web Service and am able to retrieve calendar events using the FindItem function. I have the function returning the IDOnly and making an additional call to GetItem to get all the properties. I am able to get everything I need with the exception of Attendees who are outside of the firm.
For example, if my company has john#abc.com and joe#abc.com email accounts and I have a calendar item with both, the EWS API is correctly returning both those are attendees.
However, if I create an event with john#abc.com and johnsmithxxxxx#gmail.com, the gmail address does not get returned in the API response even though it shows up within Outlook. Is this by design or do I need to specify some additional parameter to have the EWS API return ALL attendees regardless if they have a mailbox on the exchange server or not?

Extracting On-behalf-of property from emails in ICC

We are enabling record management for emails.
ICC with email connections for Microsoft exchange is being used for declaring emails as records
We have a requirement for maintaining the on-behalf-of property on mails in case the mail is sent by a user whose been delegated other user's mailbox.
But available system metadata for email don't have any property for this information. Is there a way we can extract this information from emails?
In email system metadata there is a property named 'Originating User' which gives the name of the actual user who have sent the email in question.
So the 'From' property will be populated with the user on whose behalf the mail has been sent and the 'Originating User' property will be populated with actual user sending a mail.

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