Web Debug

Fix broken web applications, from servers to clients.

IIS7 Error: Bad Data 0x80090005

app pool errorWhen you try to change the application pool identity to another domain account or reset the password for that account. You type in the username and password and hit OK and you will get the following error message

There was an error while performing this operation.

Details: Bad Data. (Exception from HRESULT: 0x80090005)

Usually this is caused by Xcopy the applicationHost.config from one server to another. And on original server you changed the application pool identity to a custom identity. (Advanced Settings > Application Pool Identity > Custom Account).

Initially when you set the application pool identity to a domain account IIS has to keep a local copy of the username and password. So it stores a copy in its applicationHost.config with password encrypted. For the encryption it uses machine specific keys in the iisConfiguration and iisWasKey containers. When the applicationHost.config is moved to a different server IIS can no longer decrypt the settings.

If you still have the original server available, then the following resolution can be applied,

  • To get this working you can export and import the keys from the original server.
  • Export using the following commands

aspnetregiis -px "iisConfigurationKey" "D:\iisConfigurationKey.xml" -pri
aspnet
regiis -px "iisWasKey" "D:\iisWasKey.xml" -pri


  • And for the import use

aspnetregiis -pi "iisConfigurationKey" "D:\iisConfigurationKey.xml"
aspnet
regiis -pi "iisWasKey" "D:\iisWasKey.xml"


If original server is not available, there are two options,

  • Reinstall IIS and WAS
  • Create a support case to Microsoft to manually generates the waskey and fix the applicationHost.config.


Reference: http://blogs.msdn.com/b/vijaysk/archive/2009/03/14/caution-while-xcopying-iis-7-0-config-files.aspx

Fork me on GitHub