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.
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.