Revista Informática

Error HTTP bad request status 400 al establecer una sesión remota a Exchange con Powershell

Publicado el 15 diciembre 2017 por Aprendiendoexchange

Al intentar iniciar una sesión remota mediante powershell se presenta el siguiente error:

Connecting to remote server servidor failed with the following error message : The WinRM client received an HTTP bad request status (400), but the remote service did not include any other information about the cause of the failure...

....FullyQualifiedErrorId : -2144108175,PSSessionOpenFailed

Error HTTP bad request status 400 al establecer una sesión remota a Exchange con Powershell

El error "HTTP bad request status (400)" puede presentarse por varios motivos, la solución detallada en esta entrada en particular aplica al caso de intentar una conexión remota para administrar Exchange ejecutando el siguiente comando:

$s = New-PSSession -Name Exchange -ConfigurationName Microsoft.Exchange -ConnectionUri http://servidor/powershell

En este caso la solución es agregar el parámetro Authentication especificando Kerberos:

Error HTTP bad request status 400 al establecer una sesión remota a Exchange con Powershell Comando completo para iniciar sesión remota a Exchange por powershell:

$s = New-PSSession -Name Exchange -ConfigurationName Microsoft.Exchange -ConnectionUri http://servidor/powershell -Authentication Kerberos

Import-PSSession $s

Como alternativa a Kerberos sería posible utilizar autenticación básica ( de encontrarse habilitada), en este caso el comando sería:

$c = Get-Credential

$s = New-PSSession -Name Exchange -ConfigurationName Microsoft.Exchange -ConnectionUri http://servidor/powershell -Authentication Basic -Credential $c

Import-PSSession $s

Error HTTP bad request status 400 al establecer una sesión remota a Exchange con Powershell

Volver a la Portada de Logo Paperblog