MAPI access to Exchange Server 2010 vs EWS - exchange-server

I am trying to access some room mailbox information from a web application while connecting to Exchange Server 2010. Using the EWS, I am unable to get some AD properties such as room capacity or customly defined properties for the given rooms. However, querying directly through LDAP is not an option since the web application is external and has no access to any domain controllers.
From what I saw, a viable option would be to use MAPI in order to get the contacts from Exchange and then look for the given properties. In order to perform this kind of integration, I have the following questions:
1) Is it possible to use a standalone version of the MAPI interfaces - i.e. without Outlook installed - ?
2) Can MAPI client functions and objects be used from a server environment - i.e. no user input available - ?
3) Is there any way to use MAPI from managed code - C# or others - ?
4) Are there any other options of getting the aforementioned properties from Exchange?

1, 2 & 3) Yes. I use Redemption library for this
4) I only know about EWS & Mapi, so I think there is no other way.
Note: Before going ahead you should be sure these information are available from MAPI. Because Exchange is different from Active Directory.
This SO question may help you.

Related

Reading Exchange 2003 WebDAV custom properties with EWS after upgrading to Exchange 2010

I have an old Exchange 2003 server that we connected to via WebDAV. We had one app using it and in it we were setting some custom properties to appointments in the DAV namespace like DAV:OrderId, where OrderId is the name of the custom property.
Now we're going to move the mailbox to Exchange 2010 to start with and since there's no WebDAV support for it, I can't find a way how to read that custom property with Managed EWS (Exchange Web Services).
I tried getting them with searching through
DefaultExtendedPropertySet.Common
and
DefaultExtendedPropertySet.PublicStrings
collections, but of course they're not there.
Our app kind of needs those properties to work.
Anyone have any ideas?
Sorry I can't be more specific here, but I've not wanted to grab any custom properties off Exchange items. However, there is a way to get MAPI props in EWS, and there may be a way to dig out the custom props as well. It's worth a look. Start here, and let us know if you work it out!
Well I found what I was doing wrong.
By using MFCMapi on the Exchange 2003 server I was able to see that the actual full property name is "DAV:OrderId" and not just "OrderId". It's namespace is DefaultExtendedPropertySet.PublicStrings. So just use those two pieces of information when querying with EWS and you're good to go.

Where can I find which properties are available in each Exchange Web Services version?

First of all, I have pretty much no experience with developing Exchange Web Services-based applications.
I am developing an application that uses EWS Managed API to connect to an Exchange server. I need to support multiple Exchange versions, as I can't know in advance what version the server I'll be connecting to is running.
I was reading this article: https://msdn.microsoft.com/en-us/library/office/dd633705(v=exchg.80).aspx, and in the Unsuccessful Versioning part, it's written:
The EWS Managed API will throw an exception if the example is run because the IsAssociated property on the EmailMessage object is not available in Exchange 2007 SP1.
My question is: is there a list of which properties are available (or unavailable) in each Exchange version?
You have to keep in mind that the EWS ExchangeVersion (schema version) is not the same as the Service Version, on which Exchange is running.
Microsoft says:
[...]applications designed against earlier versions of EWS will work, in most cases, with later versions of EWS, and applications that target later versions of EWS will work if the same functionality was included in an earlier version.
You can find further information about schema versioning and your requested feature set per schema version here: https://msdn.microsoft.com/en-us/library/office/dn741586(v=exchg.150).aspx
There is no list of properties that i know off probably the closest would be if you look at the EWS Managed API source https://github.com/OfficeDev/ews-managed-api/tree/154dbc66ac018d861c73ce489839cd9f58a1b0cd/ComplexProperties .
There are strongly typed properties which Microsoft have made available on the EWS objects and you can also access the underlying extended properties these strongly type properties refer to (or that no strongly type property exists). Just because a property isn't strongly typed in a certain version of EWS doesn't mean its not accessible its just you need to use another method more on that https://msdn.microsoft.com/en-us/library/office/dn467898(v=exchg.150).aspx
There is a list of which EWS operations are available in which versions https://msdn.microsoft.com/en-us/library/office/bb409286(v=exchg.150).aspx which is generally the more important. (Eg FAI Folder Associated Item traversals where first introduced in 2010 hence why isAvailble isn't in 2007).

Best development technologies to use to connect to exchange server, discover DAGs, creating mailbox data bases etc... (preferably in C#. .net)

I am new to Development with Exchange server. I am trying to do things like conencting to exchange server, discovering and creating Database Availablity Groups (DAG), discovering and creating mail box databses within a DAG etc... programmatically.
I see there are few PowerShell cmdlets to do the above things. I am wondering what is the best development technology to use for above things? Can i use EWS Manamgement API?
the technology should be compatible with Exchange Server 2010 and 2013 and preferably .net (C# - please note that i am trying to manage remote exchange servers)
regards,
Dreamer
The only option to manage exchange server is wrapping exchange management shell cmdlets in c# and invoking them.
Please see http://social.msdn.microsoft.com/Forums/en-US/exchangesvrdevelopment/thread/155504b3-ffe3-4bdf-887a-1e61842a8697 for more details.
thank you,
Dreamer

Sending Tasks using an offline Outlook

I've a scenario wherein I need to send/assign tasks from my browser UI to the concerned. This should happen with Outlook being offline (or for that matter outlook not even configured on the terminal) so that the user can be accessing a workflow from any terminal (using his/her AD credentials) and if required should have the ability to send a task to the concerned without having to return to his own terminal to be able to do so.
I envision that the user's credentials should be used to look up the AD for his/her email ID and send a task using the same from anywhere in the intranet.
Using Outlook object library I have been able to assign/send tasks, but with the Outlook being fired up and not otherwise.
Redemption does the sync of contacts while Outlook is offline but not tasks.
Kindly help if anybody has had a chance to do something similar.
Thanks in advance.
Redemption could help you here as you can run it it on a web server which will connect to you exchange env via mapi for you.
There are other ways dependant on you version of exchange EWS or Exchange DAV.
EWS comes with a managed API now a days to take some of the sting out of it.
There are similar 3rd party libraries for Exchange DAV as well.
They all contain contact and directory lookups.

Using MAPI w/ C++, how can I open another user's Inbox?

I'm looking to write an automated monitor script to programmatically retrieve information from another user's Exchange 2003 inbox. I have working C++ code to log into MAPI and connect to my own inbox. I can also use the Control Panel->Mail applet to configure another user's mailbox into my profile, and my code can access that way. However, this was done on my desktop with Outlook installed, which provides a richer mail profile editor.
Since this will run on a server, I'd prefer not to install Outlook at all. Instead, I can install the MAPI client. I then create a simple MAPI app that pops up the mail profile wizard using MAPILogonEx() with the MAPI_LOGON_UI flag. However, the basic MAPI client doesn't have the features to configure another user's mailbox. As a requirement, I can only run this script as the service account of the monitoring application, so I cannot tell it to run as the account whose mailbox I want.
Is it still possible to connect to another user's mailbox (assuming permissions are already granted) using the basic MAPI client? Or is it absolutely necessary to install Outlook for this functionality?
I would strongly recommend using the Microsoft Exchange MAPI Client (as you have linked). It is engineered to be far more robust than the Outlook version of these libraries. You should find the API no different between Outlook and Exchange Server with respect to Extended MAPI.
You will need to use Extended MAPI (as described by Cain T S Random) to open other mail stores, and of course your application will need to be logged in as the Windows user with appropriate permissions on the Exchange server.
I see... I'm not sure how to do that explicitly; that's usually a side effect of calling CreateStoreEntryID with the wrong flags. What's you're looking to do is probably:
Get an IID_IExchangeManageStore from your default message store
Call CreateStoreEntryID
Then open that store by the entry ID
LPEXCHANGEMANAGESTORE mapiObject = NULL;
store->QueryInterface( IID_IExchangeManageStore, (LPVOID *) &mapiObject);
mapiObject->CreateStoreEntryID( server, mailbox, OPENSTORE_TAKE_OWNERSHIP |
OPENSTORE_USE_ADMIN_PRIVILEGE, &len, &buffer);
//Call OpenEntry on the entry id
If you want a more detailed example, search the source of the MFC MAPI project for CreateStoreEntryID. If you have other questions, the best place to get them answered is the microsoft.public.win32.programmer.messaging newsgroup.
Have you looked into ConfigureMsgService? I believe that works with Exchange MAPI, or are you saying you tried that and it didn't work?

Resources