The error:
"(Process w3wp.exe, PID 11284) Connection leak detected for key domain.suffix/Support/Administrator in Microsoft.Exchange.Configuration.Authorization.WSManBudgetManager class. Leaked Value 1."
indicates that a remote PowerShell session (WSMan session) is not being properly closed in Exchange Server.
Causes of the Connection Leak
Leaked WSMan Sessions
- If a script or process starts a remote PowerShell session but doesn’t close it, Exchange tracks it as a leak.
Excessive Open Sessions
- If too many unclosed sessions accumulate, Exchange enforces throttling, which can impact admin and user operations.
Stale W3WP (IIS Worker Process) Sessions
- If an Exchange Management Shell session or Admin Center (ECP) session doesn’t release resources, the W3WP process might hold onto them.
Improperly Terminated PowerShell Sessions
- If an Exchange PowerShell session crashes or is forcibly closed without properly terminating, connections remain open.
Solutions to Fix the Leak
✅ 1. Manually Close Stale WSMan Sessions
Run the following command in Exchange Management Shell (EMS) to check active remote PowerShell sessions:
Get-PSSession | Where-Object {$_.State -eq 'Opened'}
If you see multiple stale sessions, remove them:
Get-PSSession | Remove-PSSession
✅ 2. Restart IIS to Release Stuck W3WP Processes
Since the w3wp.exe process is involved, restart IIS:
iisreset /noforce
(Use /noforce
to avoid abruptly terminating sessions.)
Alternatively, restart only the Exchange Admin Center (ECP) and PowerShell virtual directories:
Restart-WebAppPool MSExchangePowerShellAppPool
Restart-WebAppPool MSExchangeECPAppPool
✅ 3. Set a Timeout for WSMan Sessions
To prevent future leaks, you can configure a timeout for idle WSMan sessions:
Open Exchange Management Shell and run:
Set-Item WSMan:\localhost\Shell\IdleTimeout 600000
(This sets the timeout to 10 minutes (600000 ms))
Apply the same setting to all users:
winrm set winrm/config/winrs '@{IdleTimeout="600000"}'
✅ 4. Reduce Open Sessions for Exchange Administrators
If an admin (e.g., Support/Administrator
) has too many open sessions, reduce the session limit:
- Check existing session quotas:
Get-ThrottlingPolicy | Select-Object Name, PowerShellMaxConcurrency
- Lower the max allowed concurrent sessions if needed:
Set-ThrottlingPolicy -Identity "DefaultThrottlingPolicy" -PowerShellMaxConcurrency 5
(Replace 5
with the appropriate number.)
✅ 5. Restart the Windows Remote Management (WinRM) Service
Since WSMan is involved, restarting WinRM can help:
Restart-Service WinRM -Force
Summary of Fixes
🔹 Close stale WSMan sessions: Get-PSSession | Remove-PSSession
🔹 Restart IIS or App Pools: iisreset /noforce
🔹 Set a timeout for idle WSMan sessions: Set-Item WSMan:\localhost\Shell\IdleTimeout 600000
🔹 Limit concurrent sessions in Exchange: Set-ThrottlingPolicy
🔹 Restart WinRM service: Restart-Service WinRM -Force
After applying these fixes, monitor the Event Viewer (Application Logs) and the Exchange Management Shell for further issues.
Let me know if you need additional help! 🚀