[chef] Re: reg winrm auth


Chronological Thread 
  • From: Mukta A < >
  • To:
  • Subject: [chef] Re: reg winrm auth
  • Date: Mon, 10 Nov 2014 06:42:55 -0500

And to get the error / stdout you might need to execute a command. Following is the complete code -

require 'winrm'
endpoint = "http://172.16.1.197:5985/wsman"
winrm = WinRM::WinRMWebService.new(endpoint, :ssl, :user => "user", :pass => "pass", :basic_auth_only => true)
winrm.cmd('dir') do |stdout, stderr|
  STDOUT.print stdout 
  STDERR.print stderr
end

On 10 November 2014 06:40, Mukta A < " target="_blank"> > wrote:
Hi Indra

Your endpoint seems incorrect. Try this -

winrm     = WinRM::WinRMWebService.new("http://172.16.1.197:5985/wsman", :plaintext, :user => "administrator", :pass => " ", :basic_auth_only => true) do
 puts "connected successfully"
end

Thanks,
Mukta.

On 8 November 2014 05:25, indra < " target="_blank"> > wrote:
Hi,

         Using winrm itself,how to authenticate windows from linux using ruby?

here is my code:
   winrm     = WinRM::WinRMWebService.new("172.16.1.197", :plaintext, :user => "administrator", :pass => " ", :basic_auth_only => true)do
 puts "connected successfully"
end

BUt it doesnot shows connect successfully ,it doesnot execute do loop ,also not showing any error

Thanks,
Indra





Archive powered by MHonArc 2.6.16.

§