# Setting up Windows without interaction

**URL:** <https://forum.ansible.com/t/setting-up-windows-without-interaction/31500>\
**Category:** Ansible Project\
**Tags:** windows\
**Created:** [October 21, 2019, 7:50pm UTC](https://forum.ansible.com/t/setting-up-windows-without-interaction/31500 "2019-10-21T19:50:41Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Fabiano\_Sidler](https://avatars.discourse-cdn.com/v4/letter/f/ad7895/32.png) [@Fabiano\_Sidler](https://forum.ansible.com/u/Fabiano_Sidler)\
**Post date:** [October 21, 2019, 7:50pm UTC](https://forum.ansible.com/t/setting-up-windows-without-interaction/31500/1 "2019-10-21T19:50:41Z")

</div>

What’s the best way to set up a Windows without any interaction?  
With Linux/Unix I’d place my SSH public key onto the installer and be able to connect to the host after first boot.  
How can this be done with Windows and WSIM?

---

<div class="post-metadata">

**Author:** ![j.r.hawkesworth](https://avatars.discourse-cdn.com/v4/letter/j/a3d4f5/32.png) [@j.r.hawkesworth](https://forum.ansible.com/u/j.r.hawkesworth)\
**Post date:** [October 22, 2019, 10:45am UTC](https://forum.ansible.com/t/setting-up-windows-without-interaction/31500/2 "2019-10-22T10:45:03Z")

</div>

Most modern versions of windows have winrm enabled by default so provided you have a suitable user with sufficient privileges, you can often connect once the OS has finished booting up.

That said, there are a lot of factors that need to be considered depending on how things are set up in the environment you are working in.

I recommend reading up on winrm here so you understand the options and can pick most appropriate for your organisation.

[Https://docs](Https://docs).ansible.com/ansible/latest/user\_guide/windows\_winrm.html

I know this sounds like a faff but once you have sorted this stuff out, you probably won't need to touch it again for ages and can get on with getting your playbooks to do what you need.  
Cheers,

Jon

---

<div class="post-metadata">

**Author:** ![Fabiano\_Sidler](https://avatars.discourse-cdn.com/v4/letter/f/ad7895/32.png) [@Fabiano\_Sidler](https://forum.ansible.com/u/Fabiano_Sidler)\
**Post date:** [October 22, 2019, 4:05pm UTC](https://forum.ansible.com/t/setting-up-windows-without-interaction/31500/3 "2019-10-22T16:05:21Z")

</div>

I’m sorry I was terribly unclear. I mean, is there a way to connect to Windows with public key authentication (instead of passwords or, beware, X509 crap)? I’d happily use SSH for Windows as well, but according to the docs, that’s not supported. Or will it be a supported way in the future?

---

<div class="post-metadata">

**Author:** ![acozine1](https://avatars.discourse-cdn.com/v4/letter/a/c89c15/32.png) [@acozine1](https://forum.ansible.com/u/acozine1)\
**Post date:** [October 22, 2019, 4:41pm UTC](https://forum.ansible.com/t/setting-up-windows-without-interaction/31500/4 "2019-10-22T16:41:52Z")

</div>

Hi Fabiano,

Ansible supports authentication using .pem certificates with WinRM to Windows machines - see [https://docs.ansible.com/ansible/devel/user\_guide/windows\_winrm.html#authentication-options](https://docs.ansible.com/ansible/devel/user_guide/windows_winrm.html#authentication-options)

Is that what you had in mind?

Alicia

---

<div class="post-metadata">

**Author:** ![j.r.hawkesworth](https://avatars.discourse-cdn.com/v4/letter/j/a3d4f5/32.png) [@j.r.hawkesworth](https://forum.ansible.com/u/j.r.hawkesworth)\
**Post date:** [October 22, 2019, 9:59pm UTC](https://forum.ansible.com/t/setting-up-windows-without-interaction/31500/5 "2019-10-22T21:59:31Z")

</div>

Ssh support for Windows was merged a little while back so as long as you are running a recent ansible and can get the ssh server support on to your Windows targets, you can give it a whirl.

[https://github.com/ansible/ansible/pull/47732](https://github.com/ansible/ansible/pull/47732)

Hope this helps

Jon
