Skip to content

TechDirectArchive

Hands-on IT, Cloud, Security & DevOps Insights

  • Home
  • About
  • Advertise With US
  • Reviews
  • Contact
  • Toggle search form
Home » Network | Monitoring » How to enable or disable WinRM via the command-line
  • image 117
    Deploy MVC Application to AWS EC2 Using RDP and Web Deploy Configuration Management Tool
  • fkeys
    Unable to change screen brightness and volume: Disable standard function keys on Mac Mac
  • windows sign in options
    Sign-in options for Windows: Ditch Password for Enhanced Security Windows
  • We cannot fine camera
    Fix we could not find a camera compatible with Windows Hello Face Windows
  • dism failed errors windows thumbnail 1
    Error 0x800f0830: Discard the modified Image and start again, no operation was performed Windows Server
  • Featured image GettingWinReady
    Fix “Getting Windows Ready” Don’t turn off your computer stuck on Windows Windows
  • preometheus
    Monitoring Synology with Prometheus and Grafana Reviews
  • any
    Install AnyDesk on Windows for remote Connections Windows

How to enable or disable WinRM via the command-line

Posted on 26/07/202301/09/2025 Christian By Christian No Comments on How to enable or disable WinRM via the command-line
enable or disable WinRM

The Windows Remote Management (WinRM) service is Microsoft’s implementation of the WS-Management (WS-Man) protocol introduced in Windows before PowerShell. It allows remote management of your device (hardware and operating systems). For WinRM scripts to run, and for the Winrm command-line tool to perform data operations, WinRM has to be configured. In this article, I will be showing you how to enable or disable WinRM via the command-line. Please see how to fix WSManFault Message 2144108526 0x80338012: Fix the client cannot connect to the destination specified in the request, and How to configure a remote server (windows) to Support Ansible.

WinRM componnets are automatically installed with all currently-supported versions of the Windows operating system. WinRM is started automatically on newer versions of Windows Server, (that is from WS 2008) to be precise at the time of writing this piece. By default, no WinRM listener is configured.

Even if the WinRM service is running, WS-Management protocol messages that request data can’t be received or sent. Internet Connection Firewall (ICF) blocks access to ports. Please see how to fix “Cannot find the computer: Fix the following error occurred while using Kerberos authentication“.

Enable WinRM

To configure the WS-Management protocol on your device, and set up the default configuration for remote management. Please enter the following command below into PowerShell. 

winrm quickconfig
WinRM-QuickConfig

Note: WinRM qucikconfig is abbreviated as winrm qc, and performs the following operations. Please see Concept of Ansible on Windows using Cygwin, how to fix “WinRM cannot complete the operation, verify that the specified computer name is valid, and how to fix “An error occurred while attempting to connect to the server: Check if the Virtual Machine Management service is running or you are not authorized to connect to this server”.

When this service is started, the startup type changes to “Automatic (Delayed)”. Starting the service in itself does not do anything as it does not listen for anything as mentioned above, and stated in the image below.

Therefore, a listener is created. This listener sends and receives WS-Management protocol messages using either HTTP or HTTPS on any IP address.

WinRM-Setup

A firewall exception is created for Windows Remote Management only for the current user profile. If the firewall profile is changed for any reason, then run winrm quickconfig to enable the firewall exception for the new profile (otherwise the exception might not be enabled).

A configuration change is made such that when a remote user connects with admin rights to this machine, the admin rights are not stripped via User Account Control (UAC). Basically, this configuration change involves modifying a registry entry.

Disable WinRM

To disable the effect of winrm quickconfig one must undo each of these changes. Kindly follow the steps below to disable WinRM from running on your device.

Disabling the WinRM Service

Either go via the Services MMC console and stop the WinRM service from running (disabled). Alternatively, use PowerShell as an Administrator. Below are the steps to do this via the command line.

Stop-Service winrm
Set-Service -Name winrm -StartupType Disabled
Stop the Listener Service

Delete the Listener

For me, this step was not necessary. If you disabled the WinRM service as explained above, this disables the listener as well. If you need a listener on another port for an application other than PowerShell, you have to keep the WinRM service running.

Also, note that Server Manager uses the same listener for remote server management as PowerShell remoting. To display the available listeners you can run this command below. For us, there isn’t any listener running.

dir wsman:\localhost\listener
Listener

Note: If you have got some listeners, Once you know the name of the listener, you can remove it with the next PowerShell command.

Remove-Item -Path WSMan:\Localhost\listener\<Listener name>

To remove all listeners, you can use this command below.

Remove-Item -Path WSMan:\Localhost\listener\listener* -Recurse

Another security benefit of removing the listener(s) is that if someone starts the WinRM service, this will also activate the listener. However, if you delete the listener before you disable the service, you have to add the listener again with the Enable-PSRemoting cmdlet

Disable Windows firewall exceptions

I will be using the GUI to disable the Firewall exception created via the Windows Defender Firewall With Advanced Security.

Windows Defender Firewall with Advanced Security provides host-based, two-way network traffic filtering and blocks unauthorized network traffic flowing into or out of the local device

As you can see, the exception is still enabled. We have to disable it. To do this, right-click on the rule and select disable rule or click on the rule, and select disable rule on the Action Pane!

Disable Windows Remote Management

As you can see below, the rule has been disabled! Please see how to fix “Connecting to a remote server failed and WinRM cannot process the request: Error code 0x8009030e occurred while using Kerberos authentication, and a specified logon session does not exist“.

Disable Windows Remote Management

To disable the firewall exceptions via PowerShell, please use the following command below

Get-NetFirewallRule | ? {$_.Displayname -eq "Windows Remote Management (HTTP-In)"} | Set-NetFirewallRule -Enabled "False"

Disable Remote UAC

Note: Please set the value of the LocalAccountTokenFilterPolicy to 0. This restricts remote access to members of the Administrators group on the PC. On devices that are not members of the AD domain, WinRM adds the LocalAccountTokenFilterPolicy registry entry to the location below and sets the value to 1.

For me, this was already disabled as shown in the image below as it is a domain joined device.  If this is not your case, please navigate to the following location via the Registry Editor.

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System

Then set the value of LocalAccountTokenFilterPolicy to 0 (zero).

LocalAccountTokenFilterPolicy

To do this via PowerShell, kindly run the command below.

Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System" -Name LocalAccountTokenFilterPolicy -Value 0

I hope you found this blog post helpful on how to enable or disable WinRM via the command-line. Please let me know in the comment section if you have any questions.

5/5 - (1 vote)

Thank you for reading this post. Kindly share it with others.

  • Click to share on X (Opens in new window) X
  • Click to share on Reddit (Opens in new window) Reddit
  • Click to share on LinkedIn (Opens in new window) LinkedIn
  • Click to share on Facebook (Opens in new window) Facebook
  • Click to share on Pinterest (Opens in new window) Pinterest
  • Click to share on Tumblr (Opens in new window) Tumblr
  • Click to share on Telegram (Opens in new window) Telegram
  • Click to share on WhatsApp (Opens in new window) WhatsApp
  • Click to share on Pocket (Opens in new window) Pocket
  • Click to share on Mastodon (Opens in new window) Mastodon
  • Click to share on Bluesky (Opens in new window) Bluesky
  • Click to share on Threads (Opens in new window) Threads
  • Click to share on Nextdoor (Opens in new window) Nextdoor
Network | Monitoring Tags:Configure WinRM, Windows 10, Windows 11, Windows Server 2016

Post navigation

Previous Post: WSManFault Message 2144108526 0x80338012: Fix the client cannot connect to the destination specified in the request
Next Post: How to Integrate Jira Software with GitHub Cloud

Related Posts

  • gnome
    Determine the version of GNOME running on your Ubuntu Linux Network | Monitoring
  • banner
    How to Check and Reset Network Data Usage in Windows 11 Network | Monitoring
  • Hub Transport 1
    Hub Transport Server: Resolving ‘Failed to Reach Running Status’ Network | Monitoring
  • How to disable web console in Cisco switches Network | Monitoring
  • Installgrafana
    Install Grafana on Windows and Windows Server Network | Monitoring
  • VBR v12 to v13
    Upgrade Veeam Backup and Replication v12.3 to v13 on Windows Network | Monitoring

More Related Articles

gnome Determine the version of GNOME running on your Ubuntu Linux Network | Monitoring
banner How to Check and Reset Network Data Usage in Windows 11 Network | Monitoring
Hub Transport 1 Hub Transport Server: Resolving ‘Failed to Reach Running Status’ Network | Monitoring
How to disable web console in Cisco switches Network | Monitoring
Installgrafana Install Grafana on Windows and Windows Server Network | Monitoring
VBR v12 to v13 Upgrade Veeam Backup and Replication v12.3 to v13 on Windows Network | Monitoring

Leave a Reply Cancel reply

You must be logged in to post a comment.

Microsoft MVP

VEEAMLEGEND

vexpert-badge-stars-5

Virtual Background

GoogleNews

Categories

veeaam100

sysadmin top30a

  • image 117
    Deploy MVC Application to AWS EC2 Using RDP and Web Deploy Configuration Management Tool
  • fkeys
    Unable to change screen brightness and volume: Disable standard function keys on Mac Mac
  • windows sign in options
    Sign-in options for Windows: Ditch Password for Enhanced Security Windows
  • We cannot fine camera
    Fix we could not find a camera compatible with Windows Hello Face Windows
  • dism failed errors windows thumbnail 1
    Error 0x800f0830: Discard the modified Image and start again, no operation was performed Windows Server
  • Featured image GettingWinReady
    Fix “Getting Windows Ready” Don’t turn off your computer stuck on Windows Windows
  • preometheus
    Monitoring Synology with Prometheus and Grafana Reviews
  • any
    Install AnyDesk on Windows for remote Connections Windows

Subscribe to Blog via Email

Enter your email address to subscribe to this blog and receive notifications of new posts by email.

Join 1,836 other subscribers
  • RSS - Posts
  • RSS - Comments
  • About
  • Authors
  • Write for us
  • Advertise with us
  • General Terms and Conditions
  • Privacy policy
  • Feedly
  • Telegram
  • Youtube
  • Facebook
  • Instagram
  • LinkedIn
  • Tumblr
  • Pinterest
  • Twitter
  • mastodon

Tags

Active Directory AWS Azure Bitlocker Microsoft Windows PowerShell WDS Windows 10 Windows 11 Windows Server 2016

Copyright © 2025 TechDirectArchive

 

Loading Comments...
 

You must be logged in to post a comment.