CrmSvcUtil authentication failed endpoint Kerberos was not found error
If you get errors like below
CrmSvcUtil.exe /url:crm.infralib.com:444/XRMServices/20../Organization.svc /username:domain\crmadmin /password:xxx /out:CRMSdkTypes.cs
CrmSvcUtil : CRM Service Utility
Exiting program with exception: The authentication endpoint Kerberos was not found on the configured Secure Token Service! Enable tracing and view the trace files for more information.
When browsing your CRM server: /adfs/services/trust/mex you receive 503 Error.
Error connecting to URL: Exception: Microsoft.Crm.CrmException: Authentication failed
Event ID: 102 Description:There was an error in enabling endpoints of Federation Service. Fix configuration errors using PowerShell cmdlets and restart the Federation Service.
System.ServiceModel.AddressAlreadyInUseException: There is already a listener on IP endpoint 0.0.0.0:808. This could happen if there is another application already listening on this endpoint or if you have multiple service endpoints in your service host with the same IP endpoint but with incompatible binding configurations. —> System.Net.Sockets.SocketException: Only one usage of each socket address (protocol/network address/port) is normally permitted
This is caused because the CRM Sandbox service is using port 808.
Network ports for the Asynchronous Service, Web Application Server, and Sandbox Processing Service server roles
The following table lists the additional ports that are used for a deployment where the Sandbox Processing Service is running on a separate computer.
|TCP||808||CRM server role communication||The Asynchronous Service and Web Application Server services communicate to the Sandbox Processing Service through this channel. The default port is 808, but can be changed in the Windows registry by adding the DWORD registry value TcpPort in the key HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\MSCRM\.|
Network ports for the Deployment Web Service server role
The following table lists the additional port that is used by the Deployment Web Service server role.
|TCP||808||Used for Fetch-based reports||Client computers that are running Fetch-based reports communicate over this port when communicating with the computer that is running the Deployment Web Service server role.|
For more info : Network ports for Microsoft Dynamics CRM
Fixing this is very easy, all you need to do is changing the TCP port used by ADFS.
Run the command below via PowerShell first.
Set-ADFSProperties –nettcpport 809
Then Restart ADFS Service.
Hope it helps.