Jump to content



Photo

WinRM - Windows remote management


  • Please log in to reply
2 replies to this topic

#1 ptrex

ptrex

    Universalist

  • MVPs
  • 2,399 posts

Posted 28 September 2008 - 05:59 PM

WinRM - Windows remote management

Very few people know or use the new features of Windows 2003, like for instance the WinRM objects.

WinRM ( windows remote management) is the Microsoft implementation of WS-Management protocol built in the operating system. WinRM first shipped in Windows Server 2003 R2 and enhanced in Windows Vista. WS-Management is a DMTF standard

In short : WinRM is a standard SOAP based firewall friendly protocol that allows hardware and operating systems from different vendors to interoperate. The main goal of this standard is to make management devices and systems easier in a heterogeneous systems.

When you are interested in using it. Your XP / Vista and Server should be configured accordingly.
For more information look here WinRM getting started

I think Vista is preconfigured having all COM objects available. But for XP you need download and install the addons.
Download WinRM

This is how the syntax works.

AutoIt         
$objWsman = ObjCreate("Wsman.Automation") $objSession = $objWsman.CreateSession() $strResource = "http://schemas.microsoft.com/wbem/wsman/1/" _         & "wmi/root/cimv2/Win32_Service?Name=Winmgmt" $strResponse = $objSession.Get($strResource) ; ConsoleWrite($strResponse & @LF); Or use XML Transform DisplayOutput($strResponse) Func DisplayOutput($strWinRMXml)     $xmlFile = ObjCreate("MSXml2.DOMdocument.3.0")     $xslFile = ObjCreate("MSXml2.DOMdocument.3.0")     $xmlFile.LoadXml($strWinRMXml)     $xslFile.Load("WsmTxt.xsl")     ConsoleWrite ($xmlFile.TransformNode($xslFile)) EndFunc ; --------------------------------------------------------------- $Wsman = ObjCreate("Wsman.Automation") $xmlFile = ObjCreate( "MSxml.DOMDocument") $xslFile = ObjCreate( "MSXml.DOMDocument" ) $Session = $Wsman.CreateSession $Response = $Session.Get("http://schemas.microsoft.com/wbem/wsman/" _     & "1/wmi/root/cimv2/Win32_Service?Name=Spooler") $xmlFile.LoadXml($Response) ;$xmlFile.Save( "c:\RawOutput.xml") $xslFile.Load( "WsmTxt.xsl" ) ConsoleWrite($xmlFile.TransformNode( $xslFile ) & @LF)ƒo݊÷ Øíz¸§²Ö¥–)àjw¢wâ‚ê➠¨¹Æ§v†œ…ç$ºÈ§‚Øb²Ç+Š›ZºÚ"µÍŽÈ[š]X[^™Hœ›Üˆ[™‚‰ˆÌ ͎ÛÓ^Qœ›ÜˆHؚ‘]™[     œ][ÝÐ]]Ò] ‘œ›Ü‰œ][ÝË œ][ÝÓ^Qœ‘[˜Éœ][ÝÊB‚‰ˆÌ ÍŽÛØš•ÜÛX[ˆHؚÜ™X]J  œ][ÝÕÜÛX[‹]]ÛX][ۉœ][ÝÊB‰ˆÌ ÍŽÛØš”ÙÜÚ[ۈH  ˆÌ ÍŽÛØš•ÜÛX[‹Ü™X]TÙÜÚ[ۊ  œ][ÝÛØØ[ÜÝ   œ][ÝË  ˆÌ ÍŽÛØš•ÜÛX[‹”ÙÜÚ[ۑ›YÕÙS›Ð]][XØ][ۈ NÈ ˆÌ ÍŽÛØš•ÜÛX[‹”ÙÜÚ[ۑ›YÕÙS›Ð]][XØ][ۊBÛۜÛÛUܚ]J ˆÌ ÍŽÛØš”ÙÜÚ[ۋ’Y[YžH    ˜[ÈŠH‚ŽËKKKKKKKKKKKKKKKKKKKKKKKKKKKKKHÈÈHÓÓHœ›Üˆ[™ˆ KKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKB‘[˜È^Qœ‘[˜Ê B‚IˆÌ ͎Ò^[X™Z^     ˆÌ ͎ÛÓ^Qœ›Ü‹›[X™‹ B‚SÙØ›Þ   œ][ÝÐÓÓHœ›ÜˆÝ œ][ÝË   œ][ÝÕÙH[˜ÙYHÓÓHœ›Üˆ  ˆÌÌÎɜ][ÝÈ   ˜[Èԓˆ    ˜[Èԓˆ ˜[È‚BBIœ][Ýٜ‹™ØÜš[ۈΈ    œ][ÝÈ    ˜[ÈPˆ    ˜[È  ˆÌ ͎ÛÓ^Qœ›Ü‹™ØÜš[ۈ  ˜[Èԓˆ ˜[È‚BBIœ][Ýٜ‹Ú[™ØÜš[ێ‰œ][ÝÈ ˜[ÈPˆ    ˜[È  ˆÌ ͎ÛÓ^Qœ›Ü‹Ú[™ØÜš[ۈ    ˜[Èԓˆ ˜[È‚BBIœ][Ýٜ‹›[X™ˆΈ  œ][ÝÈ   ˜[ÈPˆ    ˜[È  ˆÌ ͎Ò^[X™ˆ ˜[Èԓˆ ˜[È‚BBIœ][Ýٜ‹›Ýœ›ÜˆΈ   œ][ÝÈ ˜[ÈPˆ    ˜[È  ˆÌ ͎ÛÓ^Qœ›Ü‹›Ýœ›Üˆ  ˜[Èԓˆ ˜[È‚BBIœ][Ýٜ‹œØÜš[™HΈ œ][ÝÈ   ˜[ÈPˆ    ˜[È  ˆÌ ͎ÛÓ^Qœ›Ü‹œØÜš[™H  ˜[Èԓˆ ˜[È‚BBIœ][Ýٜ‹œÛݘÙHΈ œ][ÝÈ   ˜[ÈPˆ    ˜[È  ˆÌ ͎ÛÓ^Qœ›Ü‹œÛݘÙH  ˜[Èԓˆ ˜[È‚BBIœ][Ýٜ‹š[š[HΈ œ][ÝÈ ˜[ÈPˆ    ˜[È  ˆÌ ͎ÛÓ^Qœ›Ü‹š[š[H    ˜[Èԓˆ ˜[È‚BBIœ][Ýٜ‹š[Û۝^Έ    œ][ÝÈ    ˜[ÈPˆ    ˜[È  ˆÌ ͎ÛÓ^Qœ›Ü‹š[Û۝^‚BBJB‚TÙ]œ›ÜŠ JHÈÈÚXÚț܈YˆÈ[˜Ý[ۈ™]›œÂ‘[™[˜

Enjoy !!

regards

ptrex

Edited by ptrex, 28 September 2008 - 06:04 PM.








#2 arcker

arcker

    Universalist

  • Active Members
  • PipPipPipPipPipPip
  • 556 posts

Posted 29 September 2008 - 08:05 AM

excellent !
i've tried WinRM when it becomes available for WinXP / Win2K3

it's really powerful because it can have more the one listener, each doing something.

the best thing is the abaility to control all servers from one console.

I'll try to test your script but i've stopped using WinRM because of it's performance ... really poor ... like powershell.
-- Arck System _ Soon --Ideas make everything"La critique est facile, l'art est difficile"Projects :Au3Service = Run your exe as service / Updated 27/05/2011 Get it Here

#3 ptrex

ptrex

    Universalist

  • MVPs
  • 2,399 posts

Posted 29 September 2008 - 03:45 PM

@arcker

Good to hear you have been playing around with this as well.

If you have code to share let us know.

Regards,

ptrex




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users