Skip to content

TechDirectArchive

Hands-on IT, Cloud, Security, Veeam & DevOps

  • Home
  • About
  • Advertise With US
  • Reviews
  • Contact
  • Toggle search form

How to enable or disable WinRM via the command-line

Posted on 26/07/202330/06/2026 Christian By Christian No Comments on How to enable or disable WinRM via the command-line
  1. Home
  2. Windows
  3. 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.

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

  • Share on X (Opens in new window) X
  • Share on Reddit (Opens in new window) Reddit
  • Share on LinkedIn (Opens in new window) LinkedIn
  • Share on Facebook (Opens in new window) Facebook
  • Share on Pinterest (Opens in new window) Pinterest
  • Share on Tumblr (Opens in new window) Tumblr
  • Share on Telegram (Opens in new window) Telegram
  • Share on WhatsApp (Opens in new window) WhatsApp
  • Share on Mastodon (Opens in new window) Mastodon
  • Share on Bluesky (Opens in new window) Bluesky
Windows, Windows Server Tags:Configure WinRM, configure WinRM cmd enable quickconfig, disable WinRM service Windows Server, Enable disable WinRM command line Windows, enable WinRM PowerShell and cmd, reset WinRM configuration Windows, troubleshoot WinRM cmd commands, Windows 10, Windows 11, Windows Remote Management command line setup, Windows Server 2016, WinRM firewall rule command line, WinRM listener configuration command line, WinRM service start stop commands

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

  • Featured image Windows Security
    How to clear Cache and Manually Update Microsoft Defender Anti-Virus Solution
  • server 2022
    Upgrade Windows Server 2019 to 2022 via iDRAC Windows Server
  • article 1280x720.166f8634
    How to install DHCP role on Windows Server 2019 Windows Server
  • change keyboard layout windows 10 thumb800
    Prevent on-screen keyboard from starting automatically and from appearing at login Windows
  • RDlicensePerUser
    RDS client access licenses: How to install a new Per User Remote Desktop Services license Windows Server
  • Banner
    How to determine Tombstone Lifetime in Active Directory Windows Server

More Related Articles

Featured image Windows Security How to clear Cache and Manually Update Microsoft Defender Anti-Virus Solution
server 2022 Upgrade Windows Server 2019 to 2022 via iDRAC Windows Server
article 1280x720.166f8634 How to install DHCP role on Windows Server 2019 Windows Server
change keyboard layout windows 10 thumb800 Prevent on-screen keyboard from starting automatically and from appearing at login Windows
RDlicensePerUser RDS client access licenses: How to install a new Per User Remote Desktop Services license Windows Server
Banner How to determine Tombstone Lifetime in Active Directory Windows Server

Leave a Reply Cancel reply

You must be logged in to post a comment.

Microsoft MVP

vexpert-badge-stars-5

Virtual Background

VEEAMLEGEND

Categories

veeaam100

Veeam Vanguard

  • mac2022df
    Best MacBook you can find in the year 2022 Reviews
  • Slide1 1
    Enable or disable Secure Boot in Windows via UEFI Firmware Settings Windows
  • asdfgh
    All Group Policies (GPO) available to configure Microsoft Edge settings Windows Server
  • Edge browser
    Enable or disable Microsoft Edge from showing Web Content Windows
  • Featured image Microsoft Outlook
    How to Recall an Email in Microsoft Outlook Network | Monitoring
  • adm
    Create and access a hidden share folder on Windows Windows
  • BitLocker selfservice or helpdesk recovery
    Force BitLocker Recovery: Perform BitLocker Recovery via the Self-Service Portal and Helpdesk Windows Server
  • Veeam Plugin update for Proxmox
    Update Veeam Backup for Proxmox Plugin to support PVE 9.0 Backup

Subscribe to Blog via Email

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

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

Tags

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

Copyright © 2026 TechDirectArchive

Loading Comments...

You must be logged in to post a comment.