Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

exchange EWS WellKnownFolderName.PublicFoldersRoot not working!

Posted on 2013-12-12
12
Medium Priority
?
1,309 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
Implementing Azure Infrastructure Exam 70-533

This course is designed to familiarize and instruct students in the content that is covered by Microsoft Exam 70-533, Implementing Microsoft Azure Solutions. It focuses on all the November 2016 objective domain topics.

 

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 2000 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

Learn by Doing. Anytime. Anywhere.

Do you like to learn by doing?
Our labs and exercises give you the chance to do just that: Learn by performing actions on real environments.

Hands-on, scenario-based labs give you experience on real environments provided by us so you don't have to worry about breaking anything.

Question has a verified solution.

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

There are times when we need to generate a report on the inbox rules, where users have set up forwarding externally in their mailbox. In this article, I will be sharing a script I wrote to generate the report in CSV format.
A couple of months ago we ran into an issue that necessitated re-creating our Edge Subscriptions. However, when we attempted to execute the command: New-EdgeSubscription -filename C:\NewEdgeSub_01.xml we received an error indicating that the LDAP se…
The basic steps you have just learned will be implemented in this video. The basic steps are shown to configure an Exchange DAG in a live working Exchange Server Environment and manage the same (Exchange Server 2010 Software is used in a Windows Ser…
This video discusses moving either the default database or any database to a new volume.

715 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