WinRM et PowerShell à distance
Configurez WinRM pour administrer votre VPS Windows à distance via Enter-PSSession et scripts PowerShell.
Prêt à lancer votre service ? Consultez les offres et commandez en ligne.
Voir les offres et commanderWinRM et PowerShell à distance
WinRM (Windows Remote Management) permet d'administrer votre VPS Windows Anthony IT Solutions via PowerShell distant sans session RDP graphique, idéal pour scripts et automatisation.
Ce guide active WinRM, configure HTTPS listener, authentification et utilise Enter-PSSession sur Windows Server de façon sécurisée.
Ce dont vous avez besoin
- VPS Windows / Windows Server.
- PowerShell 5.1+ (PowerShell).
- Pare-feu ports 5985 (HTTP) ou 5986 (HTTPS).
- Poste admin Windows avec PowerShell.
- Accès initial RDP pour configuration.
Activer WinRM sur le VPS
-
Quick config
Enable-PSRemoting -Forceen PowerShell administrateur. -
Service WinRM
Get-Service WinRM, Running, Automatic. -
Firewall
Règles « Windows Remote Management » créées automatiquement.
-
Test local
Test-WSMan localhost
Connexion depuis poste client
'
$cred = Get-Credential\nEnter-PSSession -ComputerName 163.x.x.x -Credential $cred\nGet-Website\nExit-PSSession'
-
Enter-PSSession
Enter-PSSession -ComputerName IP_VPS -Credential (Get-Credential) -
Invoke-Command
Invoke-Command -ComputerName IP_VPS -ScriptBlock { Get-Service W3SVC } -Credential $cred -
TrustedHosts
Si pas de domaine :
Set-Item WSMan:\localhost\Client\TrustedHosts -Value 'IP_VPS' -Force -
Exit session
Exit-PSSession
Configurer listener HTTPS
-
Certificat
Créez ou importez certificat pour le hostname/IP du VPS.
-
New-Item listener
WinRM HTTPS listener sur port 5986.
-
Firewall 5986
New-NetFirewallRule pour TCP 5986.
-
Connexion HTTPS
Enter-PSSession -ComputerName IP -UseSSL -Credential $cred
Administration IIS à distance
-
Get-Website
Invoke-Command pour lister sites IIS.
-
Restart pool
Restart-WebAppPool à distance.
-
Scripts
Combinez avec tâches planifiées sur poste admin.
-
JEA
Just Enough Administration pour limiter cmdlets (avancé).
Compléments
-
Documentation
Consultez le wiki VPS Windows pour approfondir ce sujet.
Dépannage
- Access denied WinRM, Enable-PSRemoting sur VPS. Vérifiez credentials et TrustedHosts.
- Connection timeout, Pare-feu 5985/5986. VPS reachable. WinRM service running.
- SSL errors, Certificat hostname mismatch, utilisez IP ou CN correct.
Questions fréquentes
WinRM vs RDP ?
WinRM = CLI PowerShell. RDP = bureau graphique. Complémentaires.
WinRM sans domaine ?
Oui, TrustedHosts + credentials locaux.
Automatiser sans prompt ?
CredSSP ou certificats, attention sécurité.
Port WinRM custom ?
Possible via winrm.cmd ou registry, rarement nécessaire.
Guides liés
Découvrez aussi nos VPS Windows et l'ensemble des procédures sur le wiki Cloud Windows.