0

I am trying to login by exchange using following script

ExchangeService Service = new ExchangeService(ExchangeVersion.Exchange2007_SP1);
Service.Credentials = new WebCredentials("abc", "123456","mydomain.net");
Service.TraceEnabled = true;
Service.UseDefaultCredentials = false;
Service.AutodiscoverUrl("abc@mydomain.net");
Folder inbox = Folder.Bind(Service, WellKnownFolderName.Inbox);
Console.WriteLine("The folder name is " + inbox.DisplayName.ToString());

I am getting exception 'Autodiscover service couldn't be located'. Here Username and Password is correct.


I get the answer by following code.

ServicePointManager.ServerCertificateValidationCallback = CertificateValidationCallBack;
ExchangeService service = new ExchangeService(ExchangeVersion.Exchange2007_SP1);
service.TraceEnabled = true;
service.Credentials = new WebCredentials("abc@mydomain.net", "123456");
service.AutodiscoverUrl("abc@mydomain.net", RedirectionCallback);
string url=service.url.toString();

Now I want to get information of Logs and Result same like outlook provides. Please provide me way to get it.

Mark Henderson
  • 68,823
  • 31
  • 180
  • 259
NJ Bhanushali
  • 111
  • 1
  • 1
  • 2

1 Answers1

1

Try running Get-ClientAccessServer | Select Name, *Internal* | fl in the Exchange Powershell to pull back what your current settings are for the URLs and post it here.

Have you checked that Autodiscover service is working properly? Go to https://testconnectivity.microsoft.com/ and run the tests.

DanBig
  • 11,423
  • 1
  • 29
  • 53
  • Yes. Test is successful in https://testconnectivity.microsoft.com/ How/where to test "Get-ClientAccessServer | Select Name, *Internal* | fl" command? – NJ Bhanushali Jun 08 '15 at 12:36
  • Exchange Powershell. – DanBig Jun 08 '15 at 12:41
  • I have windows 8 64-bit system and i have Exchange-2007. I don't get any Exchange Management Tool setup for 64-bit which support Exchange-2007. Please suggest me way to achieve this. – NJ Bhanushali Jun 09 '15 at 11:08
  • If you don't have access to the server, you will need to contact the admin of the server. – DanBig Jun 09 '15 at 11:57