Asaf Shazar
Asaf Shazar

Reputation: 1065

The specified object was not found in the store., The process failed to get the correct properties

I'm trying to achieve folder from a user with an admin user (just for test)

        ExchangeService service = new ExchangeService(ExchangeVersion.Exchange2013_SP1);

        service.Credentials = new WebCredentials("AdminUsername", "AdminPass");
        service.AutodiscoverUrl("[email protected]", RedirectionUrlValidationCallback);

        //creates an object that will represent the desired mailbox
        Mailbox mb = new Mailbox(@"[email protected]");

        // Create Calendar object for testing
        CalendarFolder folder1 = new CalendarFolder(service);
        folder1.DisplayName = "[email protected]";
        folder1.Save(WellKnownFolderName.Calendar);


        FolderId rootCalendarFolder = new FolderId(WellKnownFolderName.Calendar, "[email protected]");
        UserConfiguration.Bind(service, "CategoryList", rootCalendarFolder, UserConfigurationProperties.All); //// error here....

That error is happening because the user I try to impersonate is a new user and never log in to OWA even once... when I logged into OWA it worked...

How can I bypass that... How can I create the objects from remote???

Most of the Topics say it Permissions Error... but I sure I have the permissions... That problem solved when I take permission and enter OWA as impersonate him...

thank you in advance

Upvotes: 4

Views: 14943

Answers (1)

Glen Scales
Glen Scales

Reputation: 22032

That error is happening because the user I try to impersonate is a new user and never log in to OWA even once... when I logged into OWA it worked...

It sounds like the Mailbox hasn't been provisioned and logging into OWA is just kicking off that process. Using EWS alone won't do the provisioning the easiest way it just send an Email to the Mailbox. Another method I've used in the past is if you run Test-MapiConnectivity https://learn.microsoft.com/en-us/powershell/module/exchange/mailboxes/test-mapiconnectivity?view=exchange-ps from the Exchange Management Shell before you run your EWS code that will always ensure that the Mailbox has been provisioned.

Upvotes: 0

Related Questions