Dear Hashvin Rao (MY),
Thank you for reaching out. We understand the urgency of the issue involving the missing ApplicationHost.config file in IIS and the failure to restore it from the CFGHISTORY_XXXXXXXXXX backup folder.
The error you're encountering—typically HRESULT: 0x80070002—suggests that the backup folder may be incomplete or the required configuration files are missing. This can occur due to antivirus quarantine, disk corruption, or a failed update. To resolve this, please verify that the backup folder contains all necessary files: applicationHost.config, administration.config, and redirection.config. If these files are present, try restoring using the following elevated command:
powershell
%windir%\system32\inetsrv\appcmd restore backup <backup-folder-name>
If no valid backup is available, you may need to copy the ApplicationHost.config from a system with a matching IIS version or rebuild the configuration manually using IIS Manager. For future prevention, we recommend enabling automatic configuration history via registry:
powershell
reg add HKLM\Software\Microsoft\InetStp\ConfigurationHistory /v EnableHistory /t REG_DWORD /d 1 /f
Please let us know if you need assistance validating backups or rebuilding your IIS configuration.
Best regards,
Quinnie Quoc.