Bug 32317 - (py)winrm -- another way to execute cmds remotely on Windows
Summary: (py)winrm -- another way to execute cmds remotely on Windows
Status: CLOSED FIXED
Alias: None
Product: New/proposed packages
Classification: Development
Component: Обычный репозиторий (show other bugs)
Version: не указана
Hardware: all Linux
: P3 enhancement
Assignee: Andrey Cherepanov
QA Contact: Andrey Cherepanov
URL: https://github.com/diyan/pywinrm
Keywords:
Depends on:
Blocks:
 
Reported: 2016-07-26 16:53 MSK by Ivan Zakharyaschev
Modified: 2016-07-28 21:45 MSK (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Ivan Zakharyaschev 2016-07-26 16:53:12 MSK
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/ .)
Comment 1 Ivan Zakharyaschev 2016-07-26 17:37:24 MSK
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 .
Comment 2 Repository Robot 2016-07-27 06:04:40 MSK
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).
Comment 3 Ivan Zakharyaschev 2016-07-28 21:45:03 MSK
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.)