Skip to content

TechDirectArchive

Hands-on IT, Cloud, Security & DevOps Insights

  • Home
  • About
  • Advertise With US
  • Contact
  • Reviews
  • Toggle search form
Home » Windows Server » How to configure a remote Windows Server to Support Ansible
  • HyperV
    How to install free Hyper-V Server on a VMware Workstation Virtualization
  • image 43
    Configure GPS location “Google Map” on your Android Studio Emulator Windows
  • Screenshot 2020 05 13 at 23.07.56
    ENA Driver on Amazon EC2: Easy Installation Guide AWS/Azure/OpenShift
  • Featured image dataTransfer.
    How to transfer data from an old PC to a new PC Windows
  • dfefeq
    Error 740: Elevated permissions are required to run DISM Windows Server
  • Windows 11 Taskmanager
    Create Task Manager Shortcuts: How to add access, pin the Task Manager on Windows 11 Windows
  • Rules of Delegation
    Assign users with rights to reset password in Active Directory Windows Server
  • screenshot 2020 02 08 at 15.53.31
    Enable Automatic Logon on Windows Windows Server

How to configure a remote Windows Server to Support Ansible

Posted on 17/04/202012/03/2024 Christian By Christian No Comments on How to configure a remote Windows Server to Support Ansible
configure remote server

In this artile, you will learn how to configure a remote Windows Server to Support Ansible. Ansible works against multiple systems in your infrastructure at the same time. It does this by selecting portions of systems listed in the Ansible inventory file. This file can be found in this location /etc/ansible/hosts. You can specify a different inventory file using the -i <path> option on the command line Since Windows Server 2012. Please see how to install and configure Ansible on Ubuntu.

Note: WinRM is enabled by default, but in most cases extra configuration is required to use WinRM with Ansible. Below are the steps to configure Windows hosts to be supported by Ansible.

Also, see how to Install and configure Ansible on Azure Virtual Machine, and how to fix “WinRM cannot complete the operation, verify that the specified computer name is valid“.

Prerequisites for managing Server with Ansible

Ensure you have the right version of PowerShell and .NET Framework.

Here is the Concept of Ansible on Windows using Cygwin, how to automate Infrastructure Deployments in the Cloud with Ansible and Azure Pipelines, and how to fix “WinRM cannot complete the operation, verify that the specified computer name is valid“

Ansible WinRM Connectivity setup for Ansible

The default ports for WinRM 2.x are HTTP port 5985 and HTTPS port 5986.

Method 1

This is my recommended method. Right-click on the content and copy the entire content into Notepad ++

The file type and extension (.ps1) must be appended as shown below. Select the location to want to have the WinRM script saved.

In my case, I have saved the file on the Desktop under the name ConfigureRemotingForAnsible.ps1

Windows
Script Source: RAW GitHub

Next, Then run the PowerShell script. as shown below. Ensure to launch PowerShell as an Administrator

Support Ansible

Navigate to the script location and run it. In this case, we have navigated to the Desktop location where we saved the script. Next, proceed and execute the WinRM script on the Windows host.

Ansible configuration

The output signifies that WinRM has successfully been installed.

This will set the basic settings. The ConfigureRemotingForAnsible.ps1 script is intended for training and development purposes only and should not be used in a production environment since it enables settings (like Basic authentication) that can be inherently insecure.

When this step is complete and the host inventory file is configured correctly as described in this IP Address UNREACHABLE: HTTP connection pool Max exceeded. Then you should be able to ping the remote host successfully as shown below.

Note: You may need to configure the Execution Policy in PowerShell in order to allow scripts to run. See the following link for more information on setting up a Windows host.

Method 2

Use this method before if you will like to run the script locally without an internet connection. To run this command remotely, use the PSEXEC command to do this

psexec \\myserver -accepteula -nobanner -s -u DOMAIN\Administrator powershell -ExecutionPolicy Bypass -Command "iwr https://raw.githubusercontent.com/ansible/ansible/devel/examples/scripts/ConfigureRemotingForAnsible.ps1 -UseBasicParsing | iex"

There is also a free utility on enabling WinRM on Windows Machine locally and remotely

I hope you found this guide on how to configure a remote Windows Server to Support Ansible very useful. Please feel free to leave a comment below.

Rate this post

Thank you for reading this post. Kindly share it with others.

  • Click to share on X (Opens in new window) X
  • Click to share on Reddit (Opens in new window) Reddit
  • Click to share on LinkedIn (Opens in new window) LinkedIn
  • Click to share on Facebook (Opens in new window) Facebook
  • Click to share on Pinterest (Opens in new window) Pinterest
  • Click to share on Tumblr (Opens in new window) Tumblr
  • Click to share on Telegram (Opens in new window) Telegram
  • Click to share on WhatsApp (Opens in new window) WhatsApp
  • Click to share on Pocket (Opens in new window) Pocket
  • Click to share on Mastodon (Opens in new window) Mastodon
  • Click to share on Bluesky (Opens in new window) Bluesky
  • Click to share on Threads (Opens in new window) Threads
  • Click to share on Nextdoor (Opens in new window) Nextdoor
Windows Server Tags:Configuration Management Tool, RemoteConnection

Post navigation

Previous Post: IP Address UNREACHABLE: HTTP connection pool Max exceeded
Next Post: Ansible error: Server unreachable, ssl: auth method ssl requires a password

Related Posts

  • VMware Error Fix
    How to fix “The process cannot access the file because another process has locked a portion of the file” Virtualization
  • image 10
    How to use Microsoft SQL Server Management Studio to Export and Import your MsSQL database from Azure to local computer AWS/Azure/OpenShift
  • newsroom hero image password security
    Unable to update the password value provided for the new password and Password Policy Windows Server
  • VBscript fixed and working in WinPE
    Windows PE working for Windows 11 and Windows Server 2022 Windows Server
  • BitLocker
    BitLocker Drive Encryption architecture and implementation types on Windows Windows Server
  • How to enable or disable Microsoft Defender Antivirus Active or Mode Mode
    Set Microsoft Defender Antivirus to Passive or Active Mode Anti-Virus Solution

More Related Articles

VMware Error Fix How to fix “The process cannot access the file because another process has locked a portion of the file” Virtualization
image 10 How to use Microsoft SQL Server Management Studio to Export and Import your MsSQL database from Azure to local computer AWS/Azure/OpenShift
newsroom hero image password security Unable to update the password value provided for the new password and Password Policy Windows Server
VBscript fixed and working in WinPE Windows PE working for Windows 11 and Windows Server 2022 Windows Server
BitLocker BitLocker Drive Encryption architecture and implementation types on Windows Windows Server
How to enable or disable Microsoft Defender Antivirus Active or Mode Mode Set Microsoft Defender Antivirus to Passive or Active Mode Anti-Virus Solution

Leave a Reply Cancel reply

You must be logged in to post a comment.

Microsoft MVP

VEEAMLEGEND

vexpert-badge-stars-5

Virtual Background

GoogleNews

Categories

veeaam100

sysadmin top30a

  • HyperV
    How to install free Hyper-V Server on a VMware Workstation Virtualization
  • image 43
    Configure GPS location “Google Map” on your Android Studio Emulator Windows
  • Screenshot 2020 05 13 at 23.07.56
    ENA Driver on Amazon EC2: Easy Installation Guide AWS/Azure/OpenShift
  • Featured image dataTransfer.
    How to transfer data from an old PC to a new PC Windows
  • dfefeq
    Error 740: Elevated permissions are required to run DISM Windows Server
  • Windows 11 Taskmanager
    Create Task Manager Shortcuts: How to add access, pin the Task Manager on Windows 11 Windows
  • Rules of Delegation
    Assign users with rights to reset password in Active Directory Windows Server
  • screenshot 2020 02 08 at 15.53.31
    Enable Automatic Logon on Windows Windows Server

Subscribe to Blog via Email

Enter your email address to subscribe to this blog and receive notifications of new posts by email.

Join 1,839 other subscribers
  • RSS - Posts
  • RSS - Comments
  • About
  • Authors
  • Write for us
  • Advertise with us
  • General Terms and Conditions
  • Privacy policy
  • Feedly
  • Telegram
  • Youtube
  • Facebook
  • Instagram
  • LinkedIn
  • Tumblr
  • Pinterest
  • Twitter
  • mastodon

Tags

AWS Azure Bitlocker Microsoft Windows PowerShell WDS Windows 10 Windows 11 Windows Deployment Services Windows Server 2016

Copyright © 2025 TechDirectArchive

 

Loading Comments...
 

You must be logged in to post a comment.