39

I modified a lot of options in IIS, and would like to reset its settings to default.

I already tried installing/reinstalling it. After the reinstall, it still had the site I created. It was still breaking on the setting I made to the DefaultWebSite.

People suggested uninstalling Windows Process Activation Service first, but it seems like it wasn't installed anyway, so I can't really uninstall it.

How can I reset this installation of IIS back to an out-of-the-box state?

p.campbell
  • 98,673
  • 67
  • 256
  • 322
TPR
  • 2,567
  • 10
  • 41
  • 65
  • Which settings are you worried about? What's preventing you from creating a new site? There aren't many options to tweak on IIS itself, but the majority are at the site level. – p.campbell Nov 30 '11 at 04:21

6 Answers6

25

You need to uninstall IIS (Internet Information Services) but the key thing here is to make sure you uninstall the Windows Process Activation Service or otherwise your ApplicationHost.config will be still around. When you uninstall WAS then your configuration will be cleaned up and you will truly start with a fresh new IIS (and all data/configuration will be lost).

Carlos Aguilar Mares
  • 13,411
  • 2
  • 39
  • 36
  • 3
    step by step process: http://stackoverflow.com/questions/17792419/iis-7-configuration-file-is-not-well-formed-xml/17792990#17792990 – JustBeingHelpful Jul 22 '13 at 17:37
12

There are automatic backup under %systemdrive%\inetpub\history but it may not help much if you already made lots of changes.

http://blogs.iis.net/bills/archive/2008/03/24/how-to-backup-restore-iis7-configuration.aspx

You will have to regularly back up manually using appcmd.

If you try to reinstall IIS, please first uninstall IIS and WAS via Add/Remove Programs, and then delete all existing files under C:\inetpub and C:\Windows\system32\inetsrv directories. Then you can install again cleanly.

WARN: beginners on IIS are not recommended to execute the steps above without a full backup of the system. The steps should be executed with caution and good understanding of IIS. If you are not capable of or you have doubt, make sure you open a support case with Microsoft via http://support.microsoft.com and consult.

Lex Li
  • 60,503
  • 9
  • 116
  • 147
  • 1
    Deleting C:\inetpub and C:\Windows\system32\inetsrv directories destroyed what hope I had left for my IIS and it seems impossible to reinstall. – Fredrik C Oct 11 '12 at 15:51
  • @FredrikC, it is not deleting the directories that makes it impossible to reinstall. That's totally another issue, which you might learn from my blog posts, such as http://www.lextm.com/2011/02/if-you-cannot-installuninstall-iis-7.html – Lex Li Oct 12 '12 at 02:15
  • 2
    Good tip. In my case the IIS install was not critical and I had not made a lot of changes. So `appcmd.exe list backup` helped me locate a good backup. Then a simple `appcmd.exe restore backup "the backup name"` did the trick. Saved me from having to do a reinstall! Cheers. – Leigh Oct 19 '13 at 02:30
4

What worked for me was going to the article someone else had already mentioned, but keying on this piece:

application.config.backup is not created by automatic backup. The backup files are in %systemdrive%\inetpub\history directory. Automatic backup is also a Vista SP1 and above feature. More information can be found in this blog post, http://blogs.iis.net/bills/archive/2008/03/24/how-to-backup-restore-iis7-configuration.aspx

I was able to find backups of my settings from when I had first installed IIS, and just copy and replace the files in the inetsrv\config directory.

Source: http://forums.iis.net/t/1085990.aspx

probrandono
  • 528
  • 4
  • 8
3

There is one way that I have used my self. Go to Control Panel\Programs\Turn Windows features on or off then uninstall IIS and all of its components completely. I restart windows but I'm not sure if it's required or not. Then install it again from the same path.

Steve Czetty
  • 6,147
  • 9
  • 39
  • 48
Emad
  • 3,809
  • 3
  • 32
  • 44
0

This link has some useful suggestions: http://forums.iis.net/t/1085990.aspx

It depends on where you have the config settings stored. By default IIS7 will have all of it's configuration settings stored in a file called "ApplicationHost.Config". If you have delegation configured then you will see site/app related config settings getting written to web.config file for the site/app. With IIS7 on vista there is an automatica backup file for master configuration is created. This file is called "application.config.backup" and it resides inside "C:\Windows\System32\inetsrv\config" You could rename this file to applicationHost.config and replace it with the applicationHost.config inside the config folder. IIS7 on server release will have better configuration back up story, but for now I recommend using APPCMD to backup/restore your configuration on regualr basis. Example: APPCMD ADD BACK "MYBACKUP" Another option (really the last option) is to uninstall/reinstall IIS along with WPAS (Windows Process activation service).

Duke Hall
  • 582
  • 4
  • 12
  • 2
    I saw that post myself, and I think I had fiddled around that area as well, because I dont see that file there! – TPR Nov 30 '11 at 04:27
  • Also, I'm using Windows 7, not Windows Vista. – TPR Nov 30 '11 at 04:37
  • How about this one: http://community.spiceworks.com/topic/111902-how-can-i-reset-iis-7-running-on-windows-7-to-default – Duke Hall Nov 30 '11 at 04:44
  • that didn't work either. how do you feel about me copying files from a system that has IIS untouched? what files should be copied? – TPR Nov 30 '11 at 07:28
  • The forum post is not correct by saying "application.config.backup", as it never exists. – Lex Li Jul 16 '12 at 02:50
-1

Resetting IIS

  1. On the computer that is running Microsoft Dynamics NAV Web Server components, open a command prompt as an administrator as follows:

a. From the Start menu, choose All Programs, and then choose Accessories. b. Right-click Command Prompt, and then choose Run as administrator.

  1. At the command prompt, type the following command to change to the Microsoft.NET\Framework64\v4.0.30319 folder, and then press Enter.

  2. cd\Windows\Microsoft.NET\Framework64\v4.0.30319

  3. At the command prompt, type the following command, and then press Enter.

  4. aspnet_regiis.exe -iru

  5. At the command prompt, type the following command, and then press Enter. iisreset

Sumit Rajguru
  • 21
  • 1
  • 7