Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can't access public folders root

I've recently coded a .NET Console app using C#. It's purpose was to read the emails within a specific folder, parse them for specific values and save them to a database.

Our email system, at the time I originally coded this, was Exchange 2003. However, I was made aware we would soon be upgrading to Exchange 2010: ergo, I built the code to work in both environments.

Following the migration to Exchange 2010, however, the app has broken.

The app uses the EWS API for 2010 functionality. When it attempts to use the ExchangeService's FindFolders method to find the publicfoldersroot, it throws an exception. Here's the code:

ExchangeService service = new ExchangeService();
FindFoldersResults findRootFldrs;

service.UseDefaultCredentials = true;
service.AutodiscoverUrl("[email protected]", delegate(string x) {
return true; });

FolderView fview = new FolderView(100);
fview.Traversal = FolderTraversal.Deep;

findRootFldrs = service.FindFolders(WellKnownFolderName.PublicFoldersRoot, 
fview);

The exception: ErrorInvalidSchemaVersionForMailboxVersion, aka:

The mailbox that was requested doesn't support the specified RequestServerVersion

I've attempted:

  • Setting the exchangeservice to 2007 (throws an exception: "An internal server error occurred. The operation failed.")

  • Giving myself the highest level of permission to the Public Folder (no effect)

  • Manually setting my credentials (no effect)

I can view the public folders in Outlook 2007; the publicfoldersroot property is available in the intellisense; the code works on local folders (I can parse my inbox).

My current thinking is that it's a setting on the recent setup of Exchange 2010: unfortunately that isn't really my field. The exception tells me it's trying to use a previous version of Exchange. Setting it to 2007 simply causes the code to fail with an internal server error.

like image 470
Daniel Avatar asked Mar 23 '10 17:03

Daniel


People also ask

How do I enable public folders?

Navigate to Public folders > Public folders. In the list view, select the public folder that you want to mail-enable or mail-disable. In the details pane, under Mail settings, click Enable or Disable.

How do I access my public mailbox folder?

There are two ways you can manage public folder mailboxes: In the Exchange admin center (EAC), navigate to Public folders > Public folder mailboxes. In Exchange Online PowerShell, use the *-Mailbox set of cmdlets.

Can you access public folders from OWA?

When using web version of Outlook 365 (previously known as OWA), public folders are not immediately available by default. You will need to add the public folders in to your Favorites (a set of folders within your mailbox) before you can view them from your Office 365 mailbox.

How do I check public folder permissions?

This cmdlet is available in on-premises Exchange and in the cloud-based service. Some parameters and settings may be exclusive to one environment or the other. Use the Get-PublicFolderClientPermission cmdlet to retrieve the user permissions for a public folder.


3 Answers

Old post, but this turned out to be the answer for me: 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.

like image 184
SKradel Avatar answered Oct 17 '22 12:10

SKradel


Have you tried esb.RequestServerVersion.Version = ExchangeVersionType. Exchange2010 (or SP1)

like image 38
Nicolas Dorier Avatar answered Oct 17 '22 12:10

Nicolas Dorier


Change this line:

ExchangeService service = new ExchangeService(); 

to something like this:

ExchangeService service = new ExchangeService(ExchangeVersion.Exchange2010);

or

ExchangeService service = new ExchangeService(ExchangeVersion.Exchange2010_SP1);

Depending on your version.

like image 1
abend Avatar answered Oct 17 '22 11:10

abend