HRESULT: 0x80131401 Error 500 in ECP on Exchange 2013 CU23 after uninstalling SCOM
Hi,
We have an Exchange 2013 CU23 setup with a DAG, two mailstores and four servers. I uninstalled the Microsoft Monitoring Agent from the servers as we didn't intend on using it anymore, and after a reboot we are now getting error 500 when trying to access ECP, which shows in the event logs as the following:
Request for URL "EXCHANGE ADDRESS REMOVED/ecp" failed with the following error: System.Web.HttpUnhandledException (0x80004005): Exception of type 'System.Web.HttpUnhandledException' was thrown. ---> System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.Management.Automation.Runspaces.PSSnapInException: Cannot load Windows PowerShell snap-in Microsoft.Exchange.Management.Powershell.Support because of the following error: Loading this assembly would produce a different grant set from other instances. (Exception from HRESULT: 0x80131401)
The weird thing is that it's only affecting certain areas of ECP, so a user with only helpdesk permissions can log in and access mailboxes, but if they try to go to a server setting then they get the following error, whereas an Organisation Manager just get's error 500 as soon as they log into ECP.
I've seen a lot of articles relating to this error in Sharepoint but there is very little referencing Exchange 2013.
A few things to add:
- OWA and Exchange is working fine otherwise, we did have an issue with the OAUTH certificate but this has been resolved now. We can manage Exchange via Powershell so it's not a critical issue at the moment.
- I tried reinstalling the SCOM agent but this didn't fix anything.
- The best I can guess from Googling is that something in the SCOM install has persisted and is messing with IIS / .NET permissions.
- I have stopped short of recreating the ECP virtual directory but am thinking this might be the next step?
- Usual standard steps have been taken, iisreset, reboots, but nothing has made a difference.
- Upon rebooting the servers the Exchange Malware service started crashing and mails started queueing so have had to temporarily disable that.
Any suggestions on further things to try would be appreciated, thanks