Share via

Windows Server 2022 IIS 10 Shared Config

Bogdan Cirlan 5 Reputation points
2025-01-29T10:21:44.5566667+00:00

I am trying to setup a farm of IIS 10 on 2(or more in the future) Windows 2022 servers. Enabling the Shared Config is not an issue, and it is located on D:\SharedConfig folder on each server. I am configuring the websites, application pools and all the other IIS settings on server 1, then copy over the files from D:\SharedConfig folder to server 2. But, because I am using a local user(member of local Administrators group) and it's password for the default Application Pools user, the websites on the server 2 do not work. The application pool for the websites stops while trying to brose the website locally on server 2. This is because the password used for the default application pool user is encrypted, and server 1 has different encryption keys than server 2. For IIS 7(Server 2012 R2) the problem was solved by exporting and importing the RSA keys using the aspnet_regiis command(aspnet_regiis -px "iisConfigurationKey" "D:\config_keys\iisConfigurationKey.xml" -pri and aspnet_regiis -pi "iisConfigurationKey" "D:\config_keys\iisConfigurationKey.xml"). But, IIS 10 uses a different encryption mechanism(CNG), and that export does not apply anymore. What would be the way to solve this, how can I have the same encryption keys on all servers so all them can read the passwords from applicationHost.config file ?

Windows for business | Windows Client for IT Pros | User experience | Other

1 answer

Sort by: Most helpful
  1. Harry Phan 20,055 Reputation points Independent Advisor
    2025-10-07T14:23:16.06+00:00

    To ensure all servers in your IIS farm can decrypt sensitive data (like application pool passwords) from the shared applicationHost.config, you’ll need to export and import the CNG encryption keys manually using the iisconfig tool. Here's how:

    1. On Server 1, run: iisconfig.exe /export /configkey /keypath:"D:\config_keys"
    2. On Server 2, run: iisconfig.exe /import /configkey /keypath:"D:\config_keys" This imports the same key, allowing Server 2 to decrypt the configuration. Make sure the key path is accessible and permissions are properly set. Also, ensure the same user identity is used across servers for application pools, ideally a domain account to avoid local SID mismatches

    Was this answer helpful?


Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.