Here is a little howto on how to recreate the ECP directory in IIS if you can no longer log in to the Exchange Management Console. I had this error today, the Internet Explorer only showed a HTTP 400 message
First start the Exchange Management Shell and use this command to display the current directory:
Get-EcpVirtualDirectory | fl
Now you should see the settings of the current ECP directory
Now copy the values for the parameters "Identity", "InternalURL" and "ExternalURL" and then remove the directory with this command:
Remove-EcpVirtualDirectory -Identity „SMAIL02\ecp (Default Web Site)“
A new directory can now be created directly:
New-EcpVirtualDirectory -Server SMAIL02 -ExternalUrl „https://owa.frankysweb.de/ecp“ -InternalUrl
Finally, change the authentication settings, I switch off the form-based authentication in my environment and use Windows authentication.
Set-EcpVirtualDirectory -Identity „SMAIL02\ecp (Default Web Site)“ -FormsAuthentication $false -WindowsAuthentication $true
The authentication settings must match those of the OWA directory. You can display the current settings for OWA with this command
Get-OwaVirtualDirectory | fl *auth*,*url*
Finally, restart the IIS
iisreset
The management console should now work again