Fix for WinRM Error: WSManEnumeratorAddEvent parameter is null or zero
Description of the Error
This error occurs when the Windows Remote Management (WinRM) client attempts to process a request—often related to event forwarding, remote PowerShell sessions, or performance monitoring—but fails because a mandatory parameter required by the underlying WS-Management API (WSManEnumeratorAddEvent) is missing, null, or set to zero. This is usually caused by corrupted WinRM configurations, mismatched listener settings, registry discrepancies, or corrupted WMI (Windows Management Instrumentation) repositories.
Step-by-Step Easy Fixes
Follow these solutions in order until the issue is resolved.
Solution 1: Quick Reset and Restart of the WinRM Service
Refreshing the WinRM configuration and restarting the service can quickly fix broken parameters.
- Press the Windows Key, type cmd, right-click Command Prompt, and select Run as administrator.
- Type the following command to reset the WinRM configuration to its default state and press Enter:
winrm quickconfig - If prompted to make changes or enable the service, type y and press Enter.
- Force a restart of the WinRM service by running these commands sequentially:
net stop winrm net start winrm
Solution 2: Re-register the WS-Management DLL Components
Missing or unregistered system files can cause functions like WSManEnumeratorAddEvent to fail. Re-registering the core DLL can resolve this.
- Open Command Prompt as administrator.
- Run the following command to register the WS-Management automation dynamic link library:
regsvr32 WsmSvc.dll - Click OK on the pop-up confirmation dialog.
- Restart your computer.
Solution 3: Rebuild the WinRM Listeners
If a specific listener configuration has become corrupted or is missing parameters, deleting and recreating the listener will fix it.
- Open Command Prompt as administrator.
- Check your current listeners by running:
winrm enumerate winrm/config/listener - Delete the faulty or existing listeners using this command:
winrm delete winrm/config/listener?Address=*+Transport=HTTP(Note: If you are using HTTPS, replace
Transport=HTTPwithTransport=HTTPS) - Recreate the default listener by running:
winrm quickconfig
Solution 4: Repair the WMI Repository
Since WinRM relies heavily on WMI provider classes, a corrupted WMI repository can pass null parameters to WinRM functions.
- Open Command Prompt as administrator.
- Check the consistency of the WMI repository by running:
winmgt /verifyrepository - If the output states that the repository is not consistent, run the repair command:
winmgt /salvagerepository - Restart your computer and verify if the WinRM error is resolved.
There may be some errors. Learn Microsoft