Figure 1: WinRM command line options
How to activate and use WinRM
If you use Windows 2008 Server, WinRM will be installed but not enabled by default. This is an important security precaution. The easiest way to determine if WinRM is enabled and working on your computer is to prompt the CMD command and run:
winrm enumerate winrm / config / listener
If you do not see a response appear, it means WinRM is not running. To configure WinRM to automatically run and allow remote access, use the winrm quickconfig command as described below:
C: UsersAdministrator> winrm quickconfig
WinRM không đặt được để cho phép truy cập từ xa cho máy này để quản lý.
The following changes must be made:
Tạo một danh sách WinRM trên HTTP: // * để nhận được các máy phục vụ yêu cầu nào nào nào nào nào này.
Make these changes [y / n]? y
WinRM has been updated for remote management.
Created a WinRM listener on HTTP: // * to accept WS-Man requests to nào nào IP này.
C: UsersAdministrator>
Nếu bạn cấu hình quickconfig, I reran lệnh enumeration với các kết quả:
C: UsersAdministrator> winrm e winrm / config / listener
Listener
Address = *
Transport = HTTP
Port = 80
Hostname
Enabled = true
URLPrefix = wsman
CertificateThumbprint
ListeningOn = 10.253.15.98, 127.0.0.1, :: 1, fe80 :: 5efe: 10.253.15.98% 11, fe80 :: 9583: 2148: e1ef: 6444% 10
C: UsersAdministrator>
From here, we know that WinRM is enabled.
This way, if you want to disable WinRM at any point, use the command:
winrm delete winrm / config / listener? IPAdress = * + Transport = HTTP
In order to use WinRM, communication hosts need to be members of the same domain as the WinRM host.
What is WinRS and how to use it
WinRS is a Windows remote management utility. With WinRS, you can query remote Windows machines running WinRM. However, it should be noted that your computer must run WinRM to use WinRS.
As you can see in the figure below, winrs is a full-featured command-line tool along with effective help information display.
Figure 2: WinRS command line options
One of the most common uses for WinRS is to execute commands on the remote system. This command is communicated using the HTTP protocol / port 80 (default).
Below is an example of where we executed WinRS on localhost running WinRM. We have run two commands - ' ver ' and ' dir C: '. Each command returns with the appropriate information.
Figure 3: WinRS command illustration
Conclude
WinRM & WinRS are powerful new tools that Windows system administrators should research and use. From afar, you can install the program settings, change the settings or perform troubleshooting (as long as the network works). You can also perform more important tasks and combine WinRS with a click to perform other tasks on a list of computers.