https://github.com/diyan/pywinrm -- can be used like that: import winrm s = winrm.Session('windows-host.example.com', auth=('john.smith', 'secret')) r = s.run_cmd('ipconfig', ['/all']) (I have also read some notes at https://blogs.technet.microsoft.com/heyscriptingguy/2015/10/27/using-winrm-on-linux/ .)
It can be used by https://packages.altlinux.org/en/Sisyphus/srpms/ansible : $ rpmpeek /ALT/Sisyphus/noarch/RPMS.classic/ansible-2.0.2.0-alt2.noarch.rpm fgrep -i winrm -r . | fgrep import ./usr/lib/python2.7/site-packages/ansible/plugins/connection/winrm.py: from winrm import Response ./usr/lib/python2.7/site-packages/ansible/plugins/connection/winrm.py: from winrm.exceptions import WinRMTransportError ./usr/lib/python2.7/site-packages/ansible/plugins/connection/winrm.py: from winrm.protocol import Protocol $ It optionally uses https://packages.altlinux.org/en/Sisyphus/srpms/python-module-requests-kerberos .
python3-module-winrm-0.2.0-alt1.git -> sisyphus: * Tue Jul 26 2016 Ivan Zakharyaschev <imz@altlinux> 0.2.0-alt1.git - initial build for ALT Sisyphus (ALT#32317).
A similar functionality is provided by winexe (linked with samba) -- https://bugzilla.altlinux.org/show_bug.cgi?id=32316 . I'm including a simple wrapper around pywinrm with a command-line interface similar to winexe in python3-module-winrm-0.2.0-alt3.git. (It's useful for testing purposes.)