Skip to main content

Powershell - Secure winRM

I. Paramétrage du service

Vérifier les listener :

winrm e winrm/config/listener

Vérifier l'état de winRM :

winrm get winrm/config

II. Paramétrage trusted host

Lister les TrustedHosts :

Get-Item WSMan:\localhost\Client\TrustedHosts | Select-Object Value | Format-Table

Ajouter le host dans les TrustedHosts :

Set-Item WSMan:\localhost\Client\TrustedHosts -Value '<ip des serveurs> ou *'

III. Configuration Firewall

Ajouter une règle autorisant winRM :

New-NetFirewallRule -DisplayName "Windows Remote Management (HTTP-In)" -Profile Domain -Direction Inbound -Action Allow -RemoteAddress '<ipadress> or CIDR network' -Protocol TCP -LocalPort 5986