Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

EWS Managed API Contacts From Public Folders

Posted on 2013-05-16
1
Medium Priority
?
1,894 Views
Last Modified: 2013-05-17
I am working on an application that needs to pull contact data from a public folder.
I am able to pull contact data from a user's mailbox with the following code:
            ContactsFolder contactsfolder = ContactsFolder.Bind(service,
                                                                WellKnownFolderName.Contacts,
                                                                new PropertySet(BasePropertySet.IdOnly, FolderSchema.TotalCount));
            int numItems = contactsfolder.TotalCount < 1000 ? contactsfolder.TotalCount : 1000;
            ItemView view = new ItemView(numItems);
            view.PropertySet = new PropertySet(BasePropertySet.IdOnly, ContactSchema.DisplayName);
            FindItemsResults<Item> contactItems = service.FindItems(WellKnownFolderName.Contacts, view);

Open in new window

If I replace WellKnownFolderName.Contacts with the Folder ID of the public folder I still get the results from WellKnownFolderName.Contacts.  How can I get contacts from a public folder?
0
Comment
Question by:jmichael18
1 Comment
 
LVL 31

Accepted Solution

by:
LeeDerbyshire earned 2000 total points
ID: 39174295
WellKnownFolderName.Contacts appears twice in the code. Are you sure you are replacing
both instances?

I know that is a bit of an obvious answer, but using the public folder id should have worked,
and I can't think of anything else that would explain it.

I all else fails, turn on request tracing.

http://msdn.microsoft.com/en-us/library/exchange/dd633676(v=exchg.80).aspx
0

Featured Post

Simplify Active Directory Administration

Administration of Active Directory does not have to be hard.  Too often what should be a simple task is made more difficult than it needs to be.The solution?  Hyena from SystemTools Software.  With ease-of-use as well as powerful importing and bulk updating capabilities.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

On September 18, Experts Exchange launched the first installment of the Help Bell, a new feature for Premium Members, Team Accounts, and Qualified Experts. The Help Bell will serve as an additional tool to help teams increase question visibility.
Are you looking for the options available for exporting EDB files to PST? You may be confused as they are different in different Exchange versions. Here, I will discuss some options available.
To show how to generate a certificate request in Exchange 2013. We show this process by using the Exchange Admin Center. Log into Exchange Admin Center.:  First we need to log into the Exchange Admin Center. Navigate to the Servers >> Certificates…
This video shows how to quickly and easily deploy an email signature for all users in Office 365 and prevent it from being added to replies and forwards. (the resulting signature is applied on the server level in Exchange Online) The email signat…
Suggested Courses

916 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question