jamppi
asked on
exchange EWS WellKnownFolderName.PublicFoldersRoot not working!
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.Publi cFoldersRo ot' 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?
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.Publi
how can i traverse and search all public calendars without the path to publicfoldersroot?
or use service.findfolders to accomplish this?
ASKER
{"The specified object was not found in the store."}
Can you show me a small example of how you are using it, so I can try it with my Exchange 2010 server?
ASKER
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
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
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.
ASKER
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.
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.
Where does that error fail?
ASKER
Dim parent As Folder = Folder.Bind(service, WellKnownFolderName.Public FoldersRoo t)
execution stops here.
execution stops here.
ASKER
my first idea was to step up in the hierarchy with parent.ParentFolderId until i reach root and start traversing from there.
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.
ASKER
well that would explain why i cannot get ParentFolderId from mailboxroot.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
What error are you getting?