# How to command remote Windows node from control node

**URL:** <https://forum.ansible.com/t/how-to-command-remote-windows-node-from-control-node/26455>\
**Category:** Ansible Project\
**Tags:** windows\
**Created:** [January 10, 2018, 7:41pm UTC](https://forum.ansible.com/t/how-to-command-remote-windows-node-from-control-node/26455 "2018-01-10T19:41:06Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jonathan\_Anderson](https://avatars.discourse-cdn.com/v4/letter/j/45deac/32.png) [@Jonathan\_Anderson](https://forum.ansible.com/u/Jonathan_Anderson)\
**Post date:** [January 10, 2018, 7:41pm UTC](https://forum.ansible.com/t/how-to-command-remote-windows-node-from-control-node/26455/1 "2018-01-10T19:41:06Z")

</div>

This is a comment not a question. There are many ways to take action on a remote Windows node from the Ansible control node.

Use [Ansible Modules](http://docs.ansible.com/ansible/latest/list_of_all_modules.html) (especially those [starting with “win\_”](http://docs.ansible.com/ansible/latest/list_of_windows_modules.html)) to do something on a remote node

- name: Copy a windows file from control node to remote node  
[win\_copy](http://docs.ansible.com/ansible/latest/win_copy_module.html): src=“/etc/ansible/winFiles/getFileVersion.exe” dest=“C:/Temp/”

-name: Restart a remote node  
[win\_reboot:](http://docs.ansible.com/ansible/latest/win_reboot_module.html)

Use the Ansible [“raw:” module](http://docs.ansible.com/ansible/latest/raw_module.html) to run commands or executables on the remote node

- name: Issue a Windows command to run on a remote node from control node  
raw: [Rename](https://www.microsoft.com/resources/documentation/windows/xp/all/proddocs/en-us/rename.mspx?mfr=true)C:/temp/oldName.txt C:/temp/newName.txt

- name: Issue a Powershell Cmdlet to run on a remote node from control node  
raw: [Copy-Item](https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.management/copy-item?view=powershell-3.0) “C:/source/_._” -Destination “C:/destination/”

- name: Execute windows executable previously copied to a remote node from the control node  
raw: C:/temp/getFileVersion.exe “C:/Windows/driver.dll”

Use the Ansible [“script:”](http://docs.ansible.com/ansible/latest/script_module.html) module to **copy, run and delete** a Powershell module on the remote node from the control node.

- name: run a powershell script on a remote node from the control node  
[script:](http://docs.ansible.com/ansible/latest/script_module.html) /etc/ansible/psScripts/doesItemExist.ps1 “C:/TempBackup/”

Feel free to correct or expand this list.
