Winrm: Remove Ips from listeningOn

Winrm: Remove Ips from listeningOn
  • My machine is a Windows 10 Pro x64 @1804 (is not a server, so I posted here and not on ServerFault)
  • My final goal is enable this machine to be remote controlled using ansible, but only by a specific LAN address. This question is not about the ip to which I am opened; I ask you how to remove some IPs on which I'm listening on; these IPs are coming from virtual network interfaces like (VmWare + Vbox + Hyper-V)

I enumerated active listeners

winrm enumerate winrm/config/Listener

I got, with other infos, this row:

 ListeningOn = 127.0.0.1, 192.168.1.10, 192.168.56.1, 192.168.203.1,
               192.168.231.1, ::1, 2001:0:5ef5:79fd:1c43:1cb1:a8ed:c186,
               fe80::40:a36c:364a:53df%30, fe80::1c43:1cb1:a8ed:c186%13, 
               fe80::406b:b429:4b90:4acf%36, fe80::84c0:e900:ce4e:dead%35

I would like to remove some IPs, because are transient, due to virtualizations testes

I found another question here on SuperUser, but has no answers: Restrict WinRM communication to specific server

So, the question is: how to remove IPs from ListeningOn ?

Thanks in advance, and feel free to edit question or tags to be more clear.

1 Answer

Run cmd.exe as administrator and try the following command:

WinRM Delete WinRM/Config/Listener?Address=IP:x.x.x.x+Transport=HTTP

You could need to pay attention to the capitalization of words, if it tells you unknow operation.

Hope it can help you.

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Chloe Bennett
Author

Chloe Bennett

Chloe Bennett explores the intersection of pop culture, streaming entertainment, digital trends, and contemporary lifestyle. Her weekly commentary reaches thousands of culture enthusiasts.