Cyber Deals - Get up to 65% off on CKA, CKAD, CKS, KCNA, KCSA exams and courses!

Ansible for Windows

Checkout the Ansible Automation for Windows guides.

WinRM vs OpenSSH – Pros & Cons

Ansible supports managing Windows hosts using two connection types:

  • WinRM (Windows Remote Management) – default and traditional method.
  • OpenSSH – newer method, especially post-Windows 10 / Server 2019.

WinRM (Default)

✔️ Pros

ProsDescription
✅ Native SupportBuilt-in to Windows OS; enabled and configured on most enterprise systems.
✅ Full Module CompatibilityAll Ansible Windows modules are fully tested with WinRM.
✅ PowerShell-centricDesigned for PowerShell automation and WinRM natively uses it.
✅ Kerberos & Domain IntegrationSupports AD/Kerberos for seamless authentication in domain environments.
✅ Mature & DocumentedWinRM has been the default for years; tons of docs, blogs, support.

❌ Cons

ConsDescription
❌ Complex ConfigurationRequires setting up listeners, ports (5985/5986), HTTPS, certificates, etc.
❌ Firewall HasslesExtra firewall rules needed; port 5986 often blocked by security policies.
❌ Slow PerformanceKnown to be slower than SSH in many operations.
❌ SSL Certificate SetupSecure mode needs signed certs, which is painful in many orgs.
❌ Occasional Encoding IssuesEspecially with special characters or non-English content.
❌ No Agent ForwardingUnlike SSH, WinRM lacks native support for agent/key forwarding.

🆕 OpenSSH

✔️ Pros

ProsDescription
✅ Simpler SetupJust install OpenSSH, open port 22, and you’re good to go.
✅ Uses Existing SSH WorkflowEasy integration for teams already using SSH in Linux/macOS.
✅ Better PerformanceUsually faster than WinRM in most tasks.
✅ Standard PortUses port 22, often already open in mixed environments.
✅ Easier Key ManagementSupports SSH keys (no need for certs or complex auth).
✅ Works with SSH AgentSupports ssh-agent and agent forwarding.
❌ Cons
ConsDescription
❌ Not Fully SupportedSome Ansible Windows modules may not work or behave differently.
❌ Requires Extra SetupOpenSSH is not enabled by default on all Windows versions (esp. older).
❌ Limited AD/KerberosNo built-in support for domain/Kerberos auth like WinRM.
❌ Troubleshooting May Be HarderErrors are often lower-level and less descriptive.
❌ Inconsistent Shell ExperienceSome PowerShell-specific commands may behave oddly under SSH shell.

💡 Use Case Scenarios

ScenarioRecommendation
Domain-joined environmentWinRM (for Kerberos & seamless integration)
Hybrid/mixed Linux-Windows infraOpenSSH (for consistency and ease)
Security restrictions on custom portsOpenSSH (uses port 22)
Need speed and simplicityOpenSSH
Complex legacy systems with existing WinRM setupWinRM
AD authentication is mandatoryWinRM

📝 Summary Recommendation for Proposal

Default Option: Start with WinRM if compatibility and AD integration are top priority, especially for large enterprise or domain-joined machines.

Alternative Option: Consider OpenSSH if:

  • New environment with fewer legacy dependencies.
  • You’re already using SSH keys.
  • You want faster and easier setup.
  • The infrastructure team prefers standard SSH tooling.

Long-Term Plan: Evaluate hybrid usage, or standardize on OpenSSH as it becomes more mature and broadly supported.

📋 Proposal Add-on: Migration/Decision Factors

If switching between connection methods, consider:

  • Compatibility check for required modules.
  • Authentication needs (Kerberos vs SSH keys).
  • Security team policies (ports, protocols).
  • User familiarity (PowerShell vs bash-like environments).
  • Automation tools and their SSH/WinRM compatibility.

CredSSP

Enable CredSSP

Error: “credssp: Server did not response with a CredSSP token after step TLS Handshake - actual ‘’”,

ansible_winrm_credssp_disable_tlsv1_2

Patching windows servers through Ansible

Disclaimer: Views expressed in articles are those of the respective authors and do not necessarily reflect the views of their employers or this site. While we aim for accuracy, please verify information before relying on it, and let us know if you spot an error.
Tags:
Share:

Related Posts

Ansible for Infoblox

Ansible for Infoblox

Configure Ansible for Infoblox Install Python3 on RHEL Instal Python3 on Centos Setup Python VirtualEnv (venv) DONOT Upgrade pip to Latest !!! …

Infoblox Virtual Appliance Setup (NIOS)

Infoblox Virtual Appliance Setup (NIOS)

Installing the NIOS Virtual or Reporting Virtual Appliance Infoblox Guide Automate Infoblox Infrastructure Using Ansible Ansible and Infoblox: Roles …

Ansible

Ansible Dictionary Sample

Sample Playbook to Handle Ansible dictionary --- - name: Test play for dictionary hosts: all vars: interfaces: ansible-node-2: int1: intname: ens192 …

Ansible

Ansible awx cli

Note: This notes are based on the AAP 2.5 Installation # On Red Hat Enterprise Linux 8, the Controller CLI can be installed via dnf: dnf install …

Ansible

Istio

Envoy introduction create envoy config Change call timeout Retrying failed requests Installing Istio Istio CLI installation Installing Istio Install …

Terraform – Infrastructure as Code

Terraform – Infrastructure as Code

What is Terraform? Core Concepts Terraform Workflow Terraform Workspaces Terraform Modules Real-World Use Cases Ansible Lab on AWS AAP All-in-One on …