Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

trying to connect to winrm on server 2

Status
Not open for further replies.

sjr22

Programmer
Mar 19, 2006
4
US
Hi,

We are developing the WebServices for Management, using the utility provided by the microsoft called winrm(windows remote managemnt). I have windows 2000 R2 on server machine and vista on client machine.

I am trying to establish a session between client and server and get the details of spooler on the server back to the client. we use stand-alone vbscript for coding.

here is the sample code:

Option Explicit
dim objwsman
dim objSession
dim objConnectionOptions,Response,iFlags
Set objwsman = CreateObject("WSMAN.Automation")
Set objConnectionOptions=objwsman.CreateConnectionOptions
objConnectionOptions.Username="xyz"
objConnectionOptions.Password="xyz"
Const WSManFlagUseBasic = 4096
iFlags = WSManFlagUseBasic
Set objSession = objwsman.CreateSession(" iFlags, objConnectionOptions)

Set Response = objSession.Enumerate(" while NOT Response.AtEndofStream
DisplayOutput(Response.ReadItem)
Wend

Sub DisplayOutput(strWinRMxml)
Dim xmlFile, xslFile
Set xmlFile = CreateObject("MSXml.DOMDocument")
Set xslFile = CreateObject("MSXml.DOMDocument")
xmlFile.LoadXml(strWinRMxml)
xslFile.Load("wsmTxt.xsl")
wscript.Echo xmlFile.TransformNode(xslFile)
End Sub

when i run this code on client side, I try to capture whats going on, on the server side using Ethereal. I get an error HTTP/1.1 405 method not allowed (TEXT/HTML) on ethereal. I also get "Access denied " error on the client side.

Can anyone help me deal with this error??

Thanks in advance.
 
Hi

WinRM isn't enabled over HTTP by default: you will need to enable it and set up a listener or use HTTPS.

Regards
 
Hi Stuart,

I appreciate ur reply. but i have already configured the listener instances on the server machine. i use Windows 2003 R2 as OS, it doesnt support basic authentication with HTTPS. so i have already enabled winrm over HTTP.



 
Hi

I think you need to pass the WsmanFlagCredUserNamePassword flag as well:

iFlags = WSManFlagUseBasic Or WsmanFlagCredUserNamePassword

Regards
 
i appreciate ur reply. I could connect to the server remotely and could ge the server information. i had to enable http Basic explicitly in the configuration though i have already created listener instances.

thanks
 
Hi,

I currently have a similar project, but I am trying to connect to the BMC (SuperMicro's 1UIPMI-B) remotely during pre-boot. I have Windows 2003 Server R2 on the Client, and just the regular Windows 2003 Server on the server, but during pre-boot the OS on the server side shouldn't matter. I've read through many documentations about WinRm and WS-management, and they state that it is possible to connect to the BMC remotely using WinRm and WS-Management, but I see no documentation to do so.

My question is:
1) Is it possible to connect remotely to a server during pre-boot with my current configuration?
2) How is it possible to set up a listener on the server side if the OS is not running? Is it needed?

Any help would be appreciated, Thanks

-Minh
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top