How to fix "The WS-Management service does not support the encoding type specified."
Error Description
The Windows error "The WS-Management service does not support the encoding type specified" typically occurs when you use Windows PowerShell or Windows Remote Management (WinRM) to establish a remote connection. It signifies a mismatch in the formatting protocols between the client (your computer) and the target server. This happens because the client is attempting to send requests using an XML or data encoding method that the remote WinRM service is not configured to accept or recognize.
Step-by-Step Fixes
Fix 1: Configure WinRM Data Compatibility
Enabling legacy or compatible data processing on your machine usually resolves encoding conflicts.
- Click the Start menu, type
cmd, right-click Command Prompt, and select Run as administrator. - Type the following command to allow the WinRM service to process compatible data XML payloads, then press Enter:
winrm set winrm/config/service @{CompatibilityProcessorScenario="True"} - Restart the WinRM service to apply changes:
net stop winrm net start winrm
Fix 2: Reset WinRM to Default Configuration
If the encoding error stems from corrupted configuration files or bad manual tweaks, resetting WinRM fixes it.
- Open Command Prompt as an administrator.
- Run the unconfigure command to wipe existing rules:
winrm invoke Restore winrm/config - Re-initialize the default setup by running:
winrm quickconfig - Type
y(Yes) when prompted to confirm the configuration changes and firewall exceptions.
Fix 3: Force UTF-8 Encoding in PowerShell
If you encounter this error while executing a specific script, the script might be pushing an unreadable character set. You can force your session to communicate using strict formatting standards.
- Click Start, type
PowerShell, and select Run as administrator. - Execute these two lines to force standard encoding rules for web requests and outputs within your active terminal session:
\(PSDefaultParameterValues['Invoke-RestMethod:ContentType'] = 'application/json; charset=utf-8'\)PSDefaultParameterValues['Invoke-WebRequest:ContentType'] = 'application/json; charset=utf-8' - Try re-running your remote connection or script.
Fix 4: Install Missing .NET Framework Updates
WS-Management relies heavily on the .NET serialization engines. Outdated system frameworks cannot decode modern web-management packets.
- Press the Windows Key + I to open the Settings app.
- Click on Update & Security (or Windows Update on Windows 11).
- Click the Check for updates button.
- Expand Advanced options and select Optional updates to ensure all pending .NET Framework updates are completely installed.
- Reboot your machine after installation finishes.
There may be some errors. Learn Microsoft