Exchange Web Services (EWS) - How to identify if meeting participant is mail group or individual attendee - exchangewebservices

I am using EWS (Exchange Web Services) to do various operations with outlook meeting item. One of the requirement is to fetch created meeting and identify if particular participant is mail group email address or individual attendee's email address.
I could get meeting item using FindItem / GetItem however, not sure about how exactly participant's type can be checked.
Can you please suggest if any such option available with EWS ?
Thanks,

You will need a GetItem to see the attendees of a Meeting as FindItem won't return that information. Once you have the recipients you can check the MailboxType property https://learn.microsoft.com/en-us/dotnet/api/microsoft.exchange.webservices.data.mailboxtype?redirectedfrom=MSDN&view=exchange-ews-api . If that doesn't work then try the FindPeople operation https://learn.microsoft.com/en-us/exchange/client-developer/web-service-reference/findpeople-operation. If you using Office365 then doing a Graph lookup is probably a better and eaiser option to find that information.

Related

Is there a way to get Group Guests using the calendar service in Google Apps Script?

I am writing a tool in Google Sheets to analyze my work calendar and I just noticed that if I invite a "Group" (of 23 people) it only shows up as a single guest in the calendar data. Is there a way to get access to the e-mails of the people in the group?
From my research I know there is a Groups service but I'm not sure how to even recognize that it's a group. It looks like a normal e-mail address in the calendar: "management_team#gmail.com". (I could search for that specific group name, but I'm looking for a universal solution, so I can share this tool with others.)
Any suggestions will be appreciated. Thank you.
To verify either an email is a group and to retrieve its members you need to use the Admin SDK method Groups:get
But in order to use the Admin SDK you need to be a domain admin.
Each person who uses my tool will need their own copy and they will have to enter their calendar e-mail address. (The first time they run the tool there's a rather scary permissions message, but I will only be sharing this with some office mates so that should be okay.)
When my program runs I'll use this command:
var groups = GroupsApp.getGroups();
... to get a list of all the groups to which that person belongs. (I'll also have arrays for the members of each group.) Then I'll just compare the group names against the meeting guest names. If there's a match I can pretty easily retrieve the whole list.

Get all history (versions) of an exchange meeting using EWS

I am using EWS API to manage the exchange meetings (create/update/delete). When I retrieve an appointment there is AppointmentSequenceNumber indicating version of changed appointment in the response, is there a way to get all versions (history) of the appointment?
You can search for them in the WellKnownFolderName.RecoverableItemsVersions folder using the uid property of the Appointment see https://techcommunity.microsoft.com/t5/Exchange-Team-Blog/Holy-COW-Changes-to-Recoverable-Items-versioning-in-Exchange/ba-p/600259

How do i get meeting/appointmens for more than one resource (mailbox) with EWS java api?

I have general question regarding using Exchange Web Service.
I am using ews-java-api
https://github.com/OfficeDev/ews-java-api
and also tried using JEC - Java exhange connector.
http://elich11.freeshell.org/index.html
If a company have 100 to 500 rooms our goal is to get a total list of appointments/meetings for all of these rooms at once as fast as possible.
Using this api what is the best solution for this issue that uses the least time to get a total list of appointments from a list of already known room addresses.
List attendees = new ArrayList();
attendees.add("room1#domain.com");
attendees.add("room2#domain.com");
attendees.add("room4#domain.com");
attendees.add("User1#domain.com");
attendees.add("User2#domain.com");
attendees.add("Room5#domain.com");
attendees.add("Room6#domain.com");
attendees.add("room10#domain.com");
attendees.add("room11#domain.com");
attendees.add("room12#domain.com");
attendees.add("room13#domain.com");
attendees.add("room14#domain.com");
attendees.add("room15#domain.com");
attendees.add("room16#domain.com");
I tried running through a list of email adresses in an array using impersonation for each mailbox to gain acces to the meetings. I have also tried to grant delegation to each mailbox for one specific user, so i dont have to impersonate each mailbox for the user this user to get the appointments.
My problem is with the number of rooms companies can have, both of these methods i slow because the number of webservice calls increases with the amount of mailboxes.
Is there any suppported method og workaround for extracting appointments for more than one mailbox without having to perform a webservicecall for each resource (mailbox)?
It depends of the level of detail you need for each appointment. If you need the full Appointment object there is no other way you can do it. However you may want to consider running multiple concurrent queries (you need to consider throttling will affect you a some point if you push this too far).
Otherwise if you can deal with just having the Subject,Start,EndTime for appointments then GetUserAvailbility https://learn.microsoft.com/en-us/exchange/client-developer/web-service-reference/getuseravailability-operation should work okay in batches of 100.

Fields returned from EWS getItem request on Appointment are incorrect

The add-in I'm working on makes an getItem EWS request using Office.js to get certain fields otherwise unavailable. Mainly recurrence data, the all day flag, and the the body for older Exchange versions.
Depending on the environment the fields are incorrect when composing an appointment. Once the appointment is sent (if it has attendees) or saved (if it does not have attendees) then the fields are correct.
The start date and end date are a year ahead, the subject and body are empty when they shouldn't be, and the item class is always IPM.Appointment or null regardless of whether the it's a recurring appointment. Saving the appointment via Office.js before making the ews request does not make a difference. I even tried making the ews request a few minutes after I saved the appointment.
This seems to occur for some Outlook on the web users, but not for users using the Windows clients. I tried Outlook on the web with an Office 365 account, on-premise 2016, and on-premise 2013. Only the Office 365 account seems to have this issue.
My question is, is there something I can check, like the Exchange Server version, to find out if a user will run into this issue? I want to prevent using incorrect data if possible.
This scenario occurs when calling Office.context.mailbox.item.saveAsync on a new Calendar item that has not been sent yet. We are aware of this issue and are looking into a solution to resolve this so that the API can be used as designed. The API should behave as designed in Mail and on Existing Calendar items. Note that for existing Calendar items, an update may be sent out to attendees depending on the changes that the user or the add-in made in the compose form.

Exchange Web Services: Access proposed date and time through Appointment

When a meeting invitee proposes a new meeting time, in outlook this information can be found in the "Scheduling Assistant" (outlook 2007):
Is there any way to access this information programmatically through the EWS API? The RequiredAttendees and OptionalAttendees collections of the Appointment allow me to find out whether and when the attendee has responded, but how can one access the actual proposed new time?
I haven't tried this before but here is how I think you'd go about getting this information. The EWS service and the EWS Managed API don't have this implemented as first class functionality. To be more precise, the propose new time functionality is currently available as first class functionality with Exchange Online. For Exchange Online, you will need to inspect the meeting response message XML for the ProposedStartTime and ProposedEndTime elements. So if you are using Exchange 2007, 2010, and currently 2013, you will need to do what I state in the next paragraph. You should be able to access this information by using extended properties.
An attendee that proposes a new meeting time will always result in the organizer getting a meeting message. When the organizer performs a GetItem request for the meeting message sent by an attendee, the request should request the PR_RECIPIENT_PROPOSED property. A value of true indicates that the recipient proposed a new time. This should trigger a request to get the PR_RECIPIENT_PROPOSEDENDTIME and PR_RECIPIENT_PROPOSEDSTARTTIME property values.
Here is an example of getting this type of property with the EWS Managed API;
Here is a quick property definition:
ExtendedPropertyDefinition PidTagRecipientProposed = new ExtendedPropertyDefinition(0x5FE1, MapiPropertyType.Boolean);
You cannot get this information using the EWS from the Appointment, I'm afraid. It's part of the PR_MESSAGE_RECIPIENTS property, which is a MAPI table (or Object, if you will), and EWS does not support retrieving this. Technically, you could probably get it if you want to build out the ExportItem functionality (a supported function serverside that is not built into the EWS Managed API) and pick through a massive binary stream to find the information, but that's hardly feasible. I haven't tried it myself. The other alternative would be to use something other than EWS to access the data.