**Description** Tclwinrm is an opensource tcl interface to the Microsoft Windows Remote Management protocol using remote shell. Typical uses for Tclwinrm: * manage Windows Servers from Linux * running Windows / DOS commands on Windows Servers * running Powershell scripts remotely * configuring or installing software * starting or stopping Windows services * custom application monitoring * general administration or automation * and so on ... For more information on Winrm and Remote Shell: http://msdn.microsoft.com/en-us/library/aa384426%28v=vs.85%29.aspx A Google search will provide various blog postings on setting up winrm on Windows Servers. Here is a link on setting it up on Windows Server Core 2008 R2: http://www.cloudsidekick.com/blog/files/blog3.html **Repository and Download** https://github.com/cloudsidekick/tclwinrm ** Bug and Feature Requests** https://github.com/cloudsidekick/tclwinrm/issues **How does it work?** The Tclwinrm extension uses the Microsoft Winrm protocol to establish an remote shell on the targeted Windows server and passes a script or command to the remote shell. The connection is asynchronous, therefore the remote shell is established and terminated each call. Tclwinrm uses http to connect to the Winrm port (default 5985), passing in credentials and the remote shell command. The output from the command is returned back to the caller. NOTE: currently only Basic Authentication is supporoted. Also make sure AllowUnencrypted is set to true. Quick notes on setting up the winrm service on Windows Server 2008: ====== winrm qc -q winrm set winrm/config/service/auth @{Basic="true"} winrm set winrm/config/service @{AllowUnencrypted=True} ====== **Installation** Requirements - tcl 8.5 with TclOO or tcl 8.6, Tcllib, TclCurl, Tdom Download the Tclwinrm tarfile Githum. Unzip the contents into lib/tclwinrm directory in your tcl home directory. Make sure you have Tcllib and TclCurl, Tdom and TclOO (for 8.5) installed too. **Usage** To create a new connection object to the Microsoft Winrm service: ====== ::tclwinrm::connection new
protocol - http or https (NOTE: https has not been tested) address - FQDN or ip address of Windows Server to connect to port - port, on 2008 R2 this should be 5985 for http, before R2 it was 80 user - user id with Winrs privleges, escape domain account with \ password - password for user id ====== Example: ====== set conn [::tclwinrm::connection new http 10.242.210.49 5985 administrator adminpass] ====== To send a request to the remote shell: ====== rshell