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

Setting OOF for other users using EWS

$
0
0

Hello everyone,

I try to set the OOF for other users using EWS in an Exchange 2010 SP2 environment.

I use this code:

ExchangeService service = new ExchangeService(ExchangeVersion.Exchange2010_SP2);
service.Credentials = new NetworkCredential("username", "password", "domain");
service.TraceEnabled = true;
service.TraceFlags = TraceFlags.All;
service.AutodiscoverUrl("somename@somewhere.com");

OofSettings OOFSettings = new OofSettings();
OOFSettings.ExternalAudience = OofExternalAudience.All;
OOFSettings.ExternalReply = "Test";
OOFSettings.State = OofState.Enabled;
service.SetUserOofSettings("somename@somewhere.com", OOFSettings);

The account I use is a Service Account our Exchange Team set up. I can see all service properties, so I would assume that the connection to the ExchangeService works fine.

However when SetUserOofSettings executes, I receive a ServiceResponseException “Connection did not succeed. Try again later”.

What am I missing? Unfortunately, the error message does not provide any helpful informations.

Thank you and best regards

Julian


Viewing all articles
Browse latest Browse all 7132

Trending Articles



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