Solved

exchange EWS WellKnownFolderName.PublicFoldersRoot not working!

Posted on 2013-12-12
12
1,172 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
  • 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
 

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
Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

 
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

Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

Join & Write a Comment

Suggested Solutions

Utilizing an array to gracefully append to a list of EmailAddresses
This article explains in simple steps how to renew expiring Exchange Server Internal Transport Certificate.
In this video we show how to create a Resource Mailbox in Exchange 2013. We show this process by using the Exchange Admin Center. Log into Exchange Admin Center.: Navigate to the Recipients >> Resources tab.: "Recipients" is our default selection …
how to add IIS SMTP to handle application/Scanner relays into office 365.

746 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

Need Help in Real-Time?

Connect with top rated Experts

8 Experts available now in Live!

Get 1:1 Help Now