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

error when trying autodiscoverurl with powershell

$
0
0

Hello,

I am new to Powershell, but already trained a bit. I am totally new to EWS. We just outsourced our email onto an Exchange Server 2010 SP1. I want to interact with calendar objects; according to my available skills, EWS through Powershell seems to be the good solution.

I am running my powershell commands on windows 7.

I followed instructions found in various places, and have trouble with the AutodiscoverURL (we have a CNAME, suggested by our provider) : here is what I am doing :

Import-Module -Name "C:\Program Files\Microsoft\Exchange\Web Services\2.0\Microsoft.Exchange.WebServices.dll"

$exchService = New-Object Microsoft.Exchange.WebServices.Data.ExchangeService([Microsoft.Exchange.WebServices.Data.ExchangeVersion]::Exchange2010_SP1)

$exchService.UseDefaultCredentials = $true

$exchService.AutodiscoverUrl("administrator@cedrat.com", {$true})


as a result, I always get the same error (even with EWS API 1.2) :

Exception calling "AutodiscoverUrl" with "2" argument(s): "The Autodiscover service couldn't be located."
At line:1 char:29
+ $exchService.AutodiscoverUrl <<<< ("administrator@cedrat.com", {$true})
    + CategoryInfo          : NotSpecified: (:) [], MethodInvocationException
    + FullyQualifiedErrorId : DotNetMethodException

can anybody help me here ?

Regards

R. Grasso



Viewing all articles
Browse latest Browse all 7132

Trending Articles



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