ptrex Posted September 28, 2008 Share Posted September 28, 2008 (edited) 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. expandcollapse popup$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[YH [ÈHËKKKKKKKKKKKKKKKKKKKKKKKKKKKKKHÈÈHÓÓHÜ[KKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKB[È^Q[Ê BIÌÍÒ^[XZ^ ÌÍÛÓ^QÜ[X BSÙØÞ ][ÝÐÓÓ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Ü[ÛÛ^ÂBBJBTÙ]ÜJHÈÈÚXÚÈÜYÈ[Ý[Û]Â[[ Enjoy !! regards ptrex Edited September 28, 2008 by ptrex Contributions :Firewall Log Analyzer for XP - Creating COM objects without a need of DLL's - UPnP support in AU3Crystal Reports Viewer - PDFCreator in AutoIT - Duplicate File FinderSQLite3 Database functionality - USB Monitoring - Reading Excel using SQLRun Au3 as a Windows Service - File Monitor - Embedded Flash PlayerDynamic Functions - Control Panel Applets - Digital Signing Code - Excel Grid In AutoIT - Constants for Special Folders in WindowsRead data from Any Windows Edit Control - SOAP and Web Services in AutoIT - Barcode Printing Using PS - AU3 on LightTD WebserverMS LogParser SQL Engine in AutoIT - ImageMagick Image Processing - Converter @ Dec - Hex - Bin -Email Address Encoder - MSI Editor - SNMP - MIB ProtocolFinancial Functions UDF - Set ACL Permissions - Syntax HighLighter for AU3ADOR.RecordSet approach - Real OCR - HTTP Disk - PDF Reader Personal Worldclock - MS Indexing Engine - Printing ControlsGuiListView - Navigation (break the 4000 Limit barrier) - Registration Free COM DLL Distribution - Update - WinRM SMART Analysis - COM Object Browser - Excel PivotTable Object - VLC Media Player - Windows LogOnOff Gui -Extract Data from Outlook to Word & Excel - Analyze Event ID 4226 - DotNet Compiler Wrapper - Powershell_COM - New Link to comment Share on other sites More sharing options...
arcker Posted September 29, 2008 Share Posted September 29, 2008 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 :[list] [*]Au3Service : Run your exe as service V3 / Updated 29/07/2013 Get it Here [/list] Link to comment Share on other sites More sharing options...
ptrex Posted September 29, 2008 Author Share Posted September 29, 2008 @arcker Good to hear you have been playing around with this as well. If you have code to share let us know. Regards, ptrex Contributions :Firewall Log Analyzer for XP - Creating COM objects without a need of DLL's - UPnP support in AU3Crystal Reports Viewer - PDFCreator in AutoIT - Duplicate File FinderSQLite3 Database functionality - USB Monitoring - Reading Excel using SQLRun Au3 as a Windows Service - File Monitor - Embedded Flash PlayerDynamic Functions - Control Panel Applets - Digital Signing Code - Excel Grid In AutoIT - Constants for Special Folders in WindowsRead data from Any Windows Edit Control - SOAP and Web Services in AutoIT - Barcode Printing Using PS - AU3 on LightTD WebserverMS LogParser SQL Engine in AutoIT - ImageMagick Image Processing - Converter @ Dec - Hex - Bin -Email Address Encoder - MSI Editor - SNMP - MIB ProtocolFinancial Functions UDF - Set ACL Permissions - Syntax HighLighter for AU3ADOR.RecordSet approach - Real OCR - HTTP Disk - PDF Reader Personal Worldclock - MS Indexing Engine - Printing ControlsGuiListView - Navigation (break the 4000 Limit barrier) - Registration Free COM DLL Distribution - Update - WinRM SMART Analysis - COM Object Browser - Excel PivotTable Object - VLC Media Player - Windows LogOnOff Gui -Extract Data from Outlook to Word & Excel - Analyze Event ID 4226 - DotNet Compiler Wrapper - Powershell_COM - New Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now