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

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

HTTP bad request status (400) al intentar una sesión remota a un servidor con Exchange

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


Solución

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

Configurar sesión remota por Powershell para conectarse a un servidor con Exchange

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


About Daniel Núñez Banega

Consultor IT especializado en Microsoft Exchange, Active Directory y Microsoft 365.
Principales Certificaciones: Microsoft Certified Trainer | Microsoft Certified Solutions Expert | Microsoft Certified Systems Engineer | Microsoft Certified Systems Administrator | Microsoft Certified IT Professional | Microsoft Certified Technology Specialist | Microsoft 365 Certified: Enterprise Administrator Expert | Microsoft 365 Certified: Security Administrator Associate | Microsoft Certified: Cybersecurity Architect Expert | Comptia Pentest+ | EC-Council Certified Ethical Hacker Master

Reader Interactions

Deja una respuesta

Tu dirección de correo electrónico no será publicada. Los campos obligatorios están marcados con *