How to use Powershell to remotely manage Windows Server (WinRM)

  

In Linux, we can use remote SSH for remote management. However, under Windows
, in addition to the insecure Telnet, another command-line management method has been provided from Windows
Server 2008, which is WinRM based on PowerShell.

The following describes how to use WinRM:

1, configure WinRM on Windows Server 2008:

C:\\Windows\\system32> winrm quickconfig On this computer, WinRM is set to receive requests. WinRM is not set up to allow remote access to this computer. The following changes must be made: Create a WinRM listener on HTTP://* to accept WS-Man requests for any IP on this machine. Make these changes [y/n]? y WinRM has been updated for remote management. Create a WinRM listener on HTTP://* to accept WS-Man requests for any IP on this machine.


2, start the firewall:


C:\\Windows\\system32>netsh advfirewall firewall set rule group="Windows Remote Management" New enable=yes


3. Connect to a remote server using PowerShell:


PS C:\\Users\\WW-PC>Enter-PSSession - Computer server name or IP


After connecting, you can operate the remote host like Telnet.

Copyright © Windows knowledge All Rights Reserved