Enable/Disable WinRM on remote hosts

Document created by Matt Ray Expert on Nov 17, 2015Last modified by fran.schwarzmann on Aug 15, 2016
Version 4Show Document
  • View in full screen mode

WSMan and has replaced WMI for Hyper-v and Microsoft APM configurations in VMTurbo 5.4 and above. WSMan will need to be enabled in order to use VMTurbo on Hyper-v before upgrading from previous versions.

Summary

  1. Download PsTools from Microsoft Technet. Extract PsExec from the archive.
  2. Create a file containing the list of hosts that you want to enable/disable WinRm. (one host per line)
  3. Download the two .BAT files attached to this wiki.
  4. Use PsExec.exe to enable/disable WinRM on remote hosts.
    1. To enable: .\PsExec.exe @$HOST_FILE_PATH -u $USERNAME -p $PASSWORD -c enable_winrm.bat
    2. To disable:  .\PsExec.exe @$HOST_FILE_PATH -u $USERNAME -p $PASSWORD -c disable_winrm.bat
  5. if you get a error message on elevated user, add the -h option to PsExec.exe:  .\PsExec.exe -h

Steps:

1. Download and extract PsExec from PsTools.

 

2. Download the attached *.bat files

They are linked at the bottom of this wiki page.

 

3. Create a text file containing the hosts.

 

hosts file

 

 

hp-dl590

 

hp-dl591

hp-dl592

4. Inside PowerShell, use PsExec to enable or disable WinRM on remote hosts.

 

Enable WinRM

 

 

.\PsExec.exe @C:\Users\marco.yuen\hosts.txt -u corp\marco.yuen -p XXXX -c C:\Users\marco.yuen\enable_winrm.bat

 

 

Disable WinRM

 

 

.\PsExec.exe @C:\Users\marco.yuen\hosts.txt -u corp\marco.yuen -p XXXX -c C:\Users\marco.yuen\disable_winrm.bat

 

Attachments

Outcomes