How to create a winrm listener on a custom port
search cancel

How to create a winrm listener on a custom port

book

Article ID: 178076

calendar_today

Updated On:

Products

Security Information Manager

Issue/Introduction

You want to collect logs from the Windows Vista / Windows 2008 / Windows 2008 R2 machine using Windows Visa/ Windows 2008 Collector but the default port used by winrm are already in use.

The default ports for winrm 1.1 are http port 80 and https port 443
The default ports for winrm 2.x are http port 5985 and https port 5986

Symptoms
Unable to create Winrm listener on port 80, 443, 5985, or 5986 as these ports are already in use


 

Cause

Winrm 1.1 and earlier use default HTTP port 80 and default HTTPS port 443 and these ports are commonly used by IIS. Winrm 2.x use default HTTP port 5985 and default HTTPS port 5986.

You want to collect windows logs using Windows Vista /Windows 2008/Windows 2008 R2 collector which requires winrm listener to be enabled and winrm quickconfig or winrm quickconfig -transport:https enable listener with default ports.

Resolution

For example you want to create winrm listener with custom HTTP port 8888. Run the below command to create this listener:

Winrm create winrm/config/listener?Address=*+Transport=HTTP @{Port="8888"}
 

  • To create HTTPS listener with custom port 8888 run this command:


Winrm create winrm/config/listener?Address=*+Transport=HTTPS @{Port="8888"}

 

  • If you already have a listener but you want to change the port run this command:


Winrm set winrm/config/listener?Address=*+Transport=HTTP @{Port="8888"}

Note: Windows 2008 R2 now uses a new version of winrm with the its default ports as: HTTP port 5985 and HTTPS port 5986.