forked from WinRb/WinRM
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathREADME
90 lines (71 loc) · 3.62 KB
/
README
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
--------------------------------------------------------------------------
Windows Remote Management (WinRM) for Ruby
--------------------------------------------------------------------------
This is a SOAP library that uses the functionality in Windows Remote
Management(WinRM) to call native object in Windows. This includes, but is
not limitted to, running batch scripts, powershell scripts and fetching WMI
variables. For more information on WinRM, please visit Microsoft's WinRM
site: http://msdn.microsoft.com/en-us/library/aa384426(v=VS.85).aspx
My Info:
BLOG: http://distributed-frostbite.blogspot.com/
Add me in LinkedIn: http://www.linkedin.com/in/danwanek
Find me on irc.freenode.net in #ruby-lang (zenChild)
--------------------------------------------------------------------------
Version 1.0.0rc1
This is a release candidate of the new version 1 code for Ruby WinRM. It
is almost a complete re-write from the previous version to support some
of the following major feature additions:
1. GSSAPI support: This is the default way that Windows authenticates and
secures WinRM messages. In order for this to work the computer you are
connecting to must be a part of an Active Directory domain and you must
have local credentials via kinit. GSSAPI support is dependent on the
gssapi gem which only supports the MIT Kerberos libraries at this time.
If you are using this method there is no longer a need to change the
WinRM service authentication settings. You can simply do a
'winrm quickconfig' on your server or enable WinRM via group policy and
everything should be working.
2. Multi-Instance support: The SOAP back-end has been completely gutted
and is now using some of the Savon core libraries for parsing and
building packets. Moving away from Handsoap allows multiple instances
to be created because the SOAP backend is no longer a Singleton type
class.
--------------------------------------------------------------------------
!!!SHOUTS OUT!!!
--------------------------------------------------------------------------
Thanks to Seth Chisamore (https://github.com/schisamo) of Opscode for his input and patches.
--------------------------------------------------------------------------
INSTALL:
gem install -r winrm
.. on the server 'winrm quickconfig' as admin
USE:
require 'winrm'
EXAMPLE:
require 'winrm'
endpoint = http://mywinrmhost:5985/wsman
krb5_realm = 'EXAMPLE.COM'
winrm = WinRM::WinRMWebService.new(endpoint, :kerberos, :realm => krb5_realm)
winrm.cmd('ipconfig /all') do |stdout, stderr|
STDOUT.print stdout
STDERR.print stderr
end
CONNECTION TYPES:
PLAINTEXT:
WinRM::WinRMWebService.new(endpoint, :plaintext, :user => myuser, :pass => mypass)
# Same but force basic authentication
WinRM::WinRMWebService.new(endpoint, :plaintext, :user => myuser, :pass => mypass, :basic_auth_only => true)
SSL:
WinRM::WinRMWebService.new(endpoint, :ssl, :user => myuser, :pass => mypass)
# Same but force basic authentication
WinRM::WinRMWebService.new(endpoint, :ssl, :user => myuser, :pass => mypass, :basic_auth_only => true)
KERBEROS:
WinRM::WinRMWebService.new(endpoint, :kerberos, :realm => 'MYREALM.COM')
--------------------------------------------------------------------------
DISCLAIMER: If you see something that could be done better or would like
to help out in the development of this code please feel free to clone the
'git' repository and send me patches:
git clone git://github.com/zenchild/WinRM.git
or add an issue on GitHub:
http://github.com/zenchild/WinRM/issues
Cheers!
--------------------------------------------------------------------------
Thurs : #9 5:30-6:30