comunicación remota de powershell v2 : cómo habilitar el tráfico sin cifrar
Estoy escribiendo un script de Powershell v2 que me gustaría ejecutar contra un servidor remoto. Cuando lo corro, obtengo el error :
Falló la conexión al servidor remoto con el siguiente mensaje de error : El cliente WinRM no puede procesar solicitud. El tráfico no cifrado es actualmente deshabilitado en el cliente configuración. Cambiar el cliente configurar y probar la solicitud nuevo. Para obtener más información, consulte el acerca Remote_Troubleshooting Ayuda tema.
I miré la ayuda en línea para acerca de _ Remote_Troubleshooting, pero no me indicó cómo habilitar el tráfico no cifrado. A continuación se muestra el script que estoy usando que me está causando problemas.
Nota: Ya he ejecutado Enable-PSRemoting en la máquina remota para permitirle aceptar solicitudes entrantes.
He intentado usar una variable de opción de sesión, pero no parece hacer ninguna diferencia.
$key = "HKLM:\SOFTWARE\Microsoft\PowerShell\1\ShellIds"
Set-ItemProperty $key ConsolePrompting True
$tvar = "password"
$password = ConvertTo-SecureString -string $tvar -asPlainText –force
$username="domain\username"
$mySessionOption = New-PSSessionOption -NoEncryption
$credential = New-Object System.Management.Automation.PSCredential($username,$password)
invoke-command -filepath C:\scripts\RemoteScript.ps1 -sessionoption $mySessionOption -authentication digest -credential $credential -computername RemoteServer
¿Cómo puedo habilitar el tráfico no cifrado?
3 answers
AllowEncrypted se define en el extremo del cliente, a través de la unidad WSMAN:. Debe estar ejecutando powershell.exe (o powershell_ise.exe) como un proceso elevado.
ps> cd WSMan:\localhost\Client
ps> dir
Name Value
---- -----
NetworkDelayms 5000
URLPrefix wsman
AllowUnencrypted false
Auth
DefaultPorts
TrustedHosts
Lo cambiarías así (después de cambiar al directorio anterior):
Ps> set-item .\allowunencrypted true true
Espero que esto ayude,
- Oisin
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2009-09-24 19:28:59
Probablemente necesitará establecer la configuración AllowUnencrypted tanto en el Cliente como en el Servicio. La configuración del Servicio debe cambiarse en el servidor remoto usando lo siguiente:
set-item -force WSMan:\localhost\Service\AllowUnencrypted $true
Y no olvides habilitar también la Autorización Digest:
set-item -force WSMan:\localhost\Service\Auth\Digest $true
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2011-11-09 19:01:32
Esto funcionó para mí:
enable-wsmancredssp –role server
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2017-08-17 10:33:23