Thursday 28 January 2021

Send-MailMessage : Mailbox unavailable. The server response was: 5.7.1 Unable to relay for nawaz@domain.com

 Issue Detail:

Was using the following powershell command to send the email from the IIS/SMTP relay

Send-MailMessage -From "nawaz@domain.com" -to "khan@domain.com" -Cc "ali@domain.com" -Subject "SUBJECT TEST with no cred" -Body "BODY Test for the email" -SmtpServer SMTPSERVERNAME -Credential USER -usessl

but was unable to do so, getting the following error.   

Error:

Send-MailMessage : Mailbox unavailable. The server response was: 5.7.1 Unable to relay for nawaz@domain.com

Solution:

Go to IIS and right click on your SMTP relay-->Properties-->Access tab-->Relay--->add the IP from where you are trying to send the emails

Send-MailMessage : Unable to send to all recipients

Issue Detail:

Was using the following powershell command to send the email from the IIS/SMTP relay

Send-MailMessage -From "nawaz@domain.com" -to "khan@domain.com" -Cc "ali@domain.com" -Subject "SUBJECT TEST with no cred" -Body "BODY Test for the email" -SmtpServer SMTPSERVERNAME -Credential USER -usessl

but was unable to do so, getting the following error.   

Error:

Send-MailMessage : Unable to send to all recipients

Solution:

Go to IIS and right click on your SMTP relay-->Properties-->Access tab-->Relay--->add the IP from where you are trying to send the emails

Thursday 14 January 2021

Resolved: (2148074274) The target principal name is incorrect

 The issue, reason and solution was here in below article. 

 Error (Target Principal Name is incorrect) when manually replicating data between domain controllers - Windows Server | Microsoft Docs

and explanation

Troubleshoot AD replication error 2146893022 - Windows Server | Microsoft Docs


Resolutions steps.

First we have to identify the PDC emulator with the following command.

using the command prompt with admin credentials.

1:

netdom query fsmo

2:

On The Faulty DC , disable the Kerberos Key Distribution Center service (KDC)

and restart the Faulty DC

3:

After restart, with Netdom reset the secure channels between this faulty DC and PDC.
To do so, Run this command in command prompt of the faulty DC.

netdom resetpwd /server: DC /userd: domain\admin /passwordd: *

Note: Where server is the name of the PDC, not the faulty DC.

Restart the faulty DC again.

Start/restart the KDC service (net start KDC)

Force replication again via repadmin /syncall /APed