How to fix "The WinRM client cannot process the request. The request must contain one and only one enumeration mode."
Error Description
The Windows Remote Management (WinRM) error "The WinRM client cannot process the request. The request must contain one and only one enumeration mode." usually occurs when there is a mismatch or corruption in the WinRM configuration properties, particularly when multiple conflicting operational switches or enumeration flags are passed simultaneously during an API call or PowerShell session initialization. It frequently stems from misconfigured WS-Management (WS-Man) listeners, corrupted PowerShell session configurations, or group policy overrides that interfere with how data packets are parsed during the initial handshake between the client and the remote endpoint.
Step-by-Step Fix
Follow these steps sequentially to resolve the issue on the affected machine.
Step 1: Restart the WinRM Service
Refreshing the service can clear stuck parameters or transient memory errors causing the enumeration conflict.
- Open the Start menu, type
cmd, right-click on Command Prompt, and select Run as administrator. - Stop the WinRM service by executing:
net stop winrm - Start the WinRM service again by executing:
net start winrm
Step 2: Repair the WinRM Configuration
Resetting the default WinRM configuration clears out any contradictory parameters that might have been automatically injected.
- In the same Administrator Command Prompt window, type the following command and press Enter:
winrm quickconfig - If prompted to make changes to configure the service and enable firewall exceptions, type
y(Yes) and press Enter.
Step 3: Remove and Recreate the WinRM Listeners
Corrupted HTTP/HTTPS listeners often trigger structural parsing errors like enumeration mode conflicts.
- In your Administrator Command Prompt, check for existing listeners by running:
winrm enumerate winrm/config/listener - Delete the problematic listeners by executing:
winrm delete winrm/config/listener?Address=*+Transport=HTTP(Note: If you use HTTPS, replace HTTP with HTTPS in the command above).
- Re-create a clean listener by running:
winrm quickconfig
Step 4: Re-register PowerShell Session Configurations
If the error occurs specifically during PowerShell remoting, the default endpoints may be corrupted.
- Open the Start menu, type
PowerShell, right-click on Windows PowerShell, and select Run as administrator. - Run the following command to restore default session endpoints:
Register-PSSessionConfiguration -Force - Restart the WinRM service one last time to apply changes:
Restart-Service winrm
There may be some errors. Learn Microsoft