Quantcast
Channel: Exchange Server Development forum
Viewing all articles
Browse latest Browse all 7132

EWS Managed API: ServiceResponseException: The specified folder could not be found in the store. (server build version 639.21)

$
0
0
I am using impersonation (using credentials of service account with ApplicationImpersonation for all mailboxes) to log on.
I autodiscover on an email address of another user. (no problem)
get the folderID of wellknownfoldername.calendar (no problem)
trying to subscribe (pull) to that folderID returns an error:  ServiceResponseException: The specified folder could not be found in the store.

trying it with another user in same store (mailbox created fresh but I did not log in to it yet) gives
ServiceResponseException: Connection did not succeed. Try again later.  (probably because the mailbox tree is not built yet but only after first logon)

To be sure the code works at all  I try it with the email address of the service account itself
No Problems there, it Subscribes fine and events yield results.


So why does the pullsubscription tell me that "The specified folder could not be found in the store" ? No access??
Maybe I need to do more than just running this in the shell:  new-managementroleassignment -name "test -role "ApplicationImpersonation" -user "EWSserviceaccount"

[EDIT]
 so... when I open outlook as the ordinary user that I want to impersonate and add the "service account" as owner to the calendar, it works. The code has no issues. hmmm...
So obviously the way I used ApplicationImpersonation can not be the correct way to give the service account proper permissions on the normal user mailboxes. Let's see...http://msdn.microsoft.com/en-us/library/bb204095.aspx states

 To configure Exchange Impersonation for all users in an organization
  1. Open the Exchange Management Shell.

  2. Run the New-ManagementRoleAssignment cmdlet to add the permission to impersonate to the specified user. The following example shows how to configure Exchange Impersonation to enable a service account to impersonate all other users in an organization.

  3. New-ManagementRoleAssignment -Name:impersonationAssignmentName -Role:ApplicationImpersonation -User:serviceAccount
Yup.. I am realy under the impression that if I replace the word serviceaccount by "MyServiceAccountUser"  I should be fine.
It must be obvious, but I don't see it.
[EDIT]








Viewing all articles
Browse latest Browse all 7132

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>