Solved

exchange EWS WellKnownFolderName.PublicFoldersRoot not working!

Posted on 2013-12-12
12
1,270 Views
Last Modified: 2014-02-17
Hi!

I'm trying to find some public calendars in exchange server.
I'm using EWS 2.0
the server is 2010 (14.3)
i'm getting an error when trying to use 'WellKnownFolderName.PublicFoldersRoot' and it seems like i'mm not getting around that issue.

how can i traverse and search all public calendars without the path to publicfoldersroot?
or use  service.findfolders to accomplish this?
0
Comment
Question by:jamppi
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 6
  • 6
12 Comments
 
LVL 96

Expert Comment

by:Bob Learned
ID: 39716909
i'm getting an error when trying to use 'WellKnownFolderName.PublicFoldersRoot'

What error are you getting?
0
 

Author Comment

by:jamppi
ID: 39716976
{"The specified object was not found in the store."}
0
 
LVL 96

Expert Comment

by:Bob Learned
ID: 39717362
Can you show me a small example of how you are using it, so I can try it with my Exchange 2010 server?
0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 

Author Comment

by:jamppi
ID: 39717786
 Public Sub GetAllFolders(service As ExchangeService, completeListOfFolderIds As List(Of Folder))

        Dim folderView As New FolderView(Integer.MaxValue)
        'Dim findFolderResults As FindFoldersResults = service.FindFolders(WellKnownFolderName.Root, folderView) 'THIS WORKS JUST FINE
        
Dim parent As Folder = Folder.Bind(service, WellKnownFolderName.PublicFoldersRoot)
        Dim test As FolderId = parent.ParentFolderId

        Dim findFolderResults As FindFoldersResults = service.FindFolders(test, New FolderView(Integer.MaxValue) With {.Traversal = FolderTraversal.Deep})
        For Each folder As Folder In findFolderResults
            completeListOfFolderIds.Add(folder)
            FindAllSubFolders(service, folder.Id, completeListOfFolderIds)
            sort(findFolderResults)
        Next
    End Sub

Open in new window

0
 
LVL 96

Expert Comment

by:Bob Learned
ID: 39717858
One possible solution, if you have migrated the Exchange server to 2010, is that the mailboxes databases are not the correct version.

Change the Default Public Folder Database for a Mailbox Database
http://technet.microsoft.com/en-us/library/bb629522.aspx

Essentially the account used to connect with EWS had a mailbox in a mailbox database whose default public folder server was still Exchange 2003. Any and all attempts to enumerate public folders over EWS failed. Swapping it out for a 2010 backend server cured it instantly.
0
 

Author Comment

by:jamppi
ID: 39717929
yes, i have read the article and others too and that is probably the problem.
The problem is that it's a server with almost 5000 mailboxes. so we cannot do changes in it just like that. that is why i'm trying to go around the problem by traversing folders.
0
 
LVL 96

Expert Comment

by:Bob Learned
ID: 39717936
Where does that error fail?
0
 

Author Comment

by:jamppi
ID: 39717957
Dim parent As Folder = Folder.Bind(service, WellKnownFolderName.PublicFoldersRoot)
execution stops here.
0
 

Author Comment

by:jamppi
ID: 39717963
my first idea was to step up in the hierarchy with parent.ParentFolderId until i reach  root and start traversing from there.
0
 
LVL 96

Expert Comment

by:Bob Learned
ID: 39717987
According to what I was reading, EWS can't enumerate if any of the mailboxes aren't configured correctly, but that is only an assumption.
0
 

Author Comment

by:jamppi
ID: 39718127
well that would explain why i cannot get ParentFolderId from mailboxroot.
0
 
LVL 96

Accepted Solution

by:
Bob Learned earned 500 total points
ID: 39718250
If you can't bind to the root folder, then you can't get ParentFolderId.  

The important comment is this, "Any and all attempts to enumerate public folders over EWS failed. Swapping it out for a 2010 back-end server cured it instantly."
0

Featured Post

Office 365 Training for IT Pros

Learn how to provision tenants, synchronize on-premise Active Directory, implement Single Sign-On, customize Office deployment, and protect your organization with eDiscovery and DLP policies.  Only from Platform Scholar.

Question has a verified solution.

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

Learn to move / copy / export exchange contacts to iPhone without using any software. Also see the issues in configuration of exchange with iPhone to migrate contacts.
Unified and professional email signatures help maintain a consistent company brand image to the outside world. This article shows how to create an email signature in Exchange Server 2010 using a transport rule and how to overcome native limitations …
In this video we show how to create a Shared Mailbox 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 Recipients >> Sha…
In this Micro Video tutorial you will learn the basics about Database Availability Groups and How to configure one using a live Exchange Server Environment. The video tutorial explains the basics of the Exchange server Database Availability grou…
Suggested Courses

628 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