Advertisements

Archive

Archive for January 22, 2019

Dynamics – Troubleshooting Server Side Sync exceptions

January 22, 2019 Leave a comment

Server-side synchronization is used to synchronize your email system with Dynamics 365 for Customer Engagement apps at the server level.

Now coming to the issue, I was configuring Server side sync on my CRM on-premise instance with ‘Gmail’ as host and got the below error while testing the mail delivery of a ‘Mailbox’ using ‘Test & Enable Mailbox’ option.

ss_1

Reason:

  • In my case, its CRM on-premise installation and were having below 3 servers
    • Front End Server – Contain CRM WebApp
    • Application Server – Contain Services (Async, Sandbox, etc..)
    • Back End Server – Contain SQL Server and SSRS
  • Issue was ‘Incoming Port’ and ‘Outgoing Port’ were not opened on my ‘Application server’ which caused the issue

Now lets see few sanity steps and how to troubleshoot issues.

[Sanity Step] Make sure Ports and Mailbox settings are correct:

  • Test the settings provided in ‘Email Server Profile’ using console application

ss_3

  • Create a simple C# console application with below code and pass the settings (i.e., Port, host names etc) mentioned in ‘Email Server Profile’

using (MailMessage mail = new MailMessage()){
int portNumber = Convert.ToInt32(ConfigurationManager.AppSettings[“port”].ToString());
var smtpAddress = ConfigurationManager.AppSettings[“smtpAddress”].ToString();
var emailFromAddress = ConfigurationManager.AppSettings[“emailFromAddress”].ToString();
var password = ConfigurationManager.AppSettings[“password”].ToString();
var emailToAddress = ConfigurationManager.AppSettings[“emailToAddress”].ToString();

mail.From = new MailAddress(emailFromAddress);
mail.To.Add(emailToAddress);
mail.Subject = “Set mail subject”;
mail.Body = “Set mail body”;
mail.IsBodyHtml = true;
using (SmtpClient smtp = new SmtpClient(smtpAddress, portNumber)){
smtp.Credentials = new NetworkCredential(emailFromAddress, password);
smtp.EnableSsl = enableSSL;
Console.WriteLine(“Sending mail…”);
smtp.Send(mail);
Console.WriteLine(“Mail has been sent…”);
}
}

App Settings:

<appSettings>
<add key=”port” value=”587″/>
<add key=”smtpAddress” value=”smtp.gmail.com”/>
<add key=”emailFromAddress” value=”rajeevpentyala@gmail.com”/>
<add key=”password” value=”*******”/>
<add key=”emailToAddress” value=”rajeevpentyala@live.com”/>
</appSettings>

[Sanity Step] Make sure your Incoming and Outgoing server locations are reachable:

  • From command prompt, ping the locations with below command and make sure you are getting response
    • Ping -t {location}   (Ex- Ping -t smtp.gmail.com)

ss_4

[Issue] If failed with “The SMTP server requires a secure connection” exception

  • Connect to your Gmail account. Link
  • Turn on the “Less secure app access” option
ss_5

Turn on ‘Less secure app access’

  • You may also get “Smtp server returned OutgoingServerSecureChannelError MustIssueStartTlsFirst exception. message and the fix is same.

[Issue] Client was not authenticated. The server response was: 5.5.1 Authentication Required

  • You might get this issue, If the password of your Email Id requires a reset. Change your password and try by providing new password in Mail Box.

Refer this article for more exhaustive list of troubleshooting options

🙂

Advertisements

C# – Configuration section cannot be used at this path

January 22, 2019 Leave a comment

Other day , while accessing my WCF service (i.e., .svc) from IIS server, I was getting below error:

iis_3

Reason:

  • In my case, Issue is with missing ‘Write’ privilege for ‘Windows Authentication’ in IIS server.

Fix:

To fix the issue follow below steps

  • Connect to your IIS server
  • Select the ‘Server node’ (i.e., Your machine name) from left ‘Connections’ pane
  • On the right ‘Features View’ pane, select ‘Feature Delegation’ option

iis_1

  • From the list, select ‘Authentication – Windows’ option and make sure the delegation set to ‘Read\Write’
    • If its only ‘Read’, click on ‘Read/Write’ link from right side ‘Set Feature Delegation’ pane.

iis_2

  • Restart your web app
  • Try to browse the files and they should work now.

iis_4

🙂