Users Guide
Crear una comunicación remota con PowerShell en el sistema host
El comando Enable-PSRemoting también inicia un oyente de WS-Man, pero solo para HTTP.
Enable-PSRemoting -SkipNetworkProfileCheck -Force
1. Si no desea que alguien utilice HTTP para conectarse al servidor, puede eliminar el oyente HTTP ejecutando el comando:
Get-ChildItem WSMan:\Localhost\listener | Where -Property Keys -eq "Transport=HTTP" |
Remove-Item -Recurse
2. Quite todos los oyentes de WS-Man para agregar el oyente de HTTPS nuevo:
Remove-Item -Path WSMan:\Localhost\listener\listener* -Recurse
3. Agregue su oyente HTTPS de WS-Man:
New-Item -Path WSMan:\LocalHost\Listener -Transport HTTPS -Address * -
CertificateThumbPrint $Cert.Thumbprint –Force
NOTA: Utilice la variable $Cert que definió anteriormente para leer la huella digital. Esta variable permite que New-
Item cmdlet encuentre el certificado en el almacén de certificados.
4. Agregar la regla de firewall:
New-NetFirewallRule -DisplayName "Windows Remote Management (HTTPS-In)" -Name "Windows
Remote Management (HTTPS-In)" -Profile Any -LocalPort 5986 -Protocol TCP
5. Verificar los valores mediante la ejecución del siguiente comando:
C:\Windows\system32>winrm g winrm/config
Config
MaxEnvelopeSizekb = 500
MaxTimeoutms = 60000
MaxBatchItems = 32000
MaxProviderRequests = 4294967295
Client
NetworkDelayms = 5000
URLPrefix = wsman
AllowUnencrypted = false
Auth
Basic = true
Digest = true
Kerberos = true
Negotiate = true
Certificate = true
CredSSP = false
DefaultPorts
HTTP = 5985
HTTPS = 5986
TrustedHosts
Service
RootSDDL = O:NSG:BAD:P(A;;GA;;;BA)(A;;GR;;;IU)S:P(AU;FA;GA;;;WD)(AU;SA;GXGW;;;WD)
MaxConcurrentOperations = 4294967295
MaxConcurrentOperationsPerUser = 1500
EnumerationTimeoutms = 240000
MaxConnections = 300
MaxPacketRetrievalTimeSeconds = 120
AllowUnencrypted = false
Auth
Basic = true
Kerberos = true
Negotiate = true
Certificate = false
CredSSP = false
CbtHardeningLevel = Relaxed
DefaultPorts
HTTP = 5985
HTTPS = 5986
IPv4Filter = *
IPv6Filter = *
Detección de dispositivos para la supervisión o administración
87