What??? You deleted "Default Web Site" from IIS?!?!

Some applications are just bent on seeing what appears to be the pristine original Default Web Site that is created when IIS is first installed.  For instance, when setting up Microsoft's own Reporting Services it depends upon having a web with the same underlying site ID as the default, “W3SVC/1“.  So you can paint yourself in a corner if you ever get a wild hair and just up and delete it one day:

To these finicky apps, anything created after the fact, even if it is called by the right name, is no longer truly *the* default site since it has a different number in the metabase.  So how do you fix it?  Some have recommended to uninstall and reinstall IIS to get things back in order.  Although that works, you lose all the configuration of any other webs on your system, which can be quite painful.  So in this post I'll show you a way to get the job done without going to that extreme.  The idea is to copy an existing web on your server to a new one with ID 1 that will then appear just like Default Web Site.  A handy VBScript program called adsutil will do the dirty work.

  1. First you want to really make sure that there is not a web known as W3SVC/1.  Who knows, maybe someone had simply renamed your default web site or something.  Open a command prompt and type this:
    c:
    cd\Inetpub\AdminScripts
    cscript adsutil.vbs enum w3svc/1
    If it comes up with "The path requested could not be found" then sure enough, you don't have a true default website anymore.  If no error then check out the "ServerComment" to know which web the machine now thinks is the default.
  2. Okay, so you really did kill it.  If you'd like to continue recreating your Default Web Site, run this to find the IDs of any other webs you do have (and you'll need at least one):
    cscript adsutil.vbs enum w3svc
    A bunch of info will fly past. Look for the folder entries at the end, which start with square brackets. You'll have w3svc/Info, w3svc/Filters, and hopefully at least one w3svc/### where the number is the interesting thing. If there are more than one then you can find the name of each with:
    cscript adsutil.vbs enum w3svc/###
    (Putting in the ###s that you saw in the list.) Check out the ServerComment property to know its name.  Find a numbered web in the list from above that you can use as a template to copy from.
  3. Now that you know an ID to use as a source, use these commands to copy this to a new web with ID 1:
    cscript adsutil.vbs create_vserv W3SVC/1
    cscript adsutil.vbs copy W3SVC/### W3SVC/1
    cscript adsutil.vbs set w3svc/1/ServerComment "Default Web Site"
    Note that with the last command there you can actually rename the new web to whatever you want to call it.  This is the name under which it will appear in the Internet Information Services MMC (aka InetMgr).
Voila! That's it. You've replicated everything across from one web to the other, and you can now go into InetMgr and administer your good-as-new Default Web Site.

Feedback

# re: What??? You deleted "Default Web Site" from IIS?!?!

Great,
Thanks a lot 4 this topic! It helped me with instaling TFS =) 9/29/2006 1:15 AM | Marius

# re: What??? You deleted "Default Web Site" from IIS?!?!

Having been looking at a way of copying a web site in order to run automated tests on it.
Thanks above script looks helpful - thanks. 3/7/2007 8:29 AM | Martin Robb

# re: What??? You deleted "Default Web Site" from IIS?!?!

Way nice! But there's my experience with it.

One thing to mention. If you copy a site over with the above information, it also copies the the vartious settings. Check to ensure that the proper ports, directorys, permissions, etcetera etcetera have been checked before starting the site. 9/27/2007 5:43 AM | Mr. Anderson

# re: What??? You deleted "Default Web Site" from IIS?!?!

Great. I had uninstalled WSS 3.0 and it removed my Default Web Site. Which included my Certificate Authority website certsrv and my Exchange OWA and additional folders. Any comments on how to reinstall these? 10/29/2007 2:27 AM | Jerry

# re: What??? You deleted "Default Web Site" from IIS?!?!

Error trying to get the object: w3svc

can u help ???

IIS 5 11/15/2007 6:27 PM | Jank

# re: What??? You deleted "Default Web Site" from IIS?!?!

great post!!!

thanks...

the reason why i was on this post was WSS 3.0. I deleted web application from Mgt and i got default web site removed too. Still, i cannt browse my site after doing this too. It seems another issue now on, but your post helped a lot...

thx again!!! 12/13/2007 8:30 PM | rohit

# You saved our butts!

You rock! We had a scary deadline, an app that wouldn't install, and a missing website. This worked perfect! 3/13/2008 4:19 PM | coruscate

# re: What??? You deleted "Default Web Site" from IIS?!?!

many thanks.
reporting services wouldn't install without this fix. MS installations always seem to take many days rather than just a few minutes. grrrr. 3/21/2008 8:01 AM | tim

# re: What??? You deleted "Default Web Site" from IIS?!?!

thanks ,its really helped me ,i thought i had to reinstall the IIS but the info really helped me. 6/17/2008 1:10 AM | kcsekhar13

# re: What??? You deleted "Default Web Site" from IIS?!?!

I don't want to lose the current default website [/w3svc/1] (Not the original default). WHen I create the new Default Website, will it replace it? or modify it?
7/24/2008 5:19 AM | Dav

# re: What??? You deleted "Default Web Site" from IIS?!?!

You are wonderfull! 8/5/2008 1:19 AM | Giovana

# re: What??? You deleted "Default Web Site" from IIS?!?!

Thank you!! Thank you!! Thank you!! 9/24/2008 4:20 AM | #

# re: What??? You deleted "Default Web Site" from IIS?!?!

Thanks mang! Awesomeness! 1/12/2009 6:36 AM | prezz0r

# re: What??? You deleted "Default Web Site" from IIS?!?!

Exactly what I was looking for but couldn't find... until now! Thank you Lorin! 3/30/2009 8:31 AM | JP

# re: What??? You deleted "Default Web Site" from IIS?!?!

Amazing! Its a miracle. 4/23/2009 10:29 PM | Roman

# re: What??? You deleted "Default Web Site" from IIS?!?!

I have an easier way, that is if you up and delete it and need it right back:

1. Right-click on the root folder in IIS where the websites exist and choose New>Website(from file...)

2. Browse to: \WINDOWS\System32\inetsrv\History

3. Choose the newest XML file in the list and choose "Read"

4. If "Default Website" exists in the list, choose it and finish.

5. If it does not show up in the list, repeat this browse/read process with the next newest file until you locate the XML file with the "Default Website" configuration, choose it and finish. 6/3/2009 7:48 AM | Anonymous

# re: What??? You deleted "Default Web Site" from IIS?!?!

reporting services wouldn't install without this fix. 7/4/2009 11:33 PM | driver scan online

# re: What??? You deleted "Default Web Site" from IIS?!?!

Thank you! Thnk you! Thank you! 7/31/2009 5:26 AM | Erica

# re: What??? You deleted "Default Web Site" from IIS?!?!

Your website is very useful. Thanks for sharing. 8/5/2009 12:19 AM | links of london

# re: What??? You deleted "Default Web Site" from IIS?!?!

Thank you very much. Very helpful. 8/18/2009 11:07 AM | Fabio

# linksoflondon

You will get more than what you exhaust. Linksoflondon jewellery can insincere show beauty and charm of female,links of london charms and know their closet, so jewelries are very infamous for offering many styles of jewels with top attribute and hot worth.linksoflondon charmis afamily jewellery is the online shopping for your home. Its matchless & piercing project, its imminent and Bangles Jewelry. The happiest female must own the good contacts of female, and then the Links London jewelries are definitely the best links of female. Family of london trinkets are always the matchless silver relations of us,links of london with which, she can keep her beloved in silver commerce satisfy all London charms getting from Coolinks to your note only. 8/25/2009 1:05 AM | links

# re: What??? You deleted "Default Web Site" from IIS?!?!

Your website is very useful. Thanks for sharing 9/14/2009 4:03 PM | cheap auto insurance quotes

# re: What??? You deleted "Default Web Site" from IIS?!?!

Great article. I did not know at first what to expect form the title of this post. Thanks.
Rehabs 10/16/2009 4:38 AM | Gerry

# re: What??? You deleted "Default Web Site" from IIS?!?!

I did not know at first what to expect form 10/17/2009 11:57 PM | Tiffany co Necklaces

# re: What??? You deleted "Default Web Site" from IIS?!?!

dsfalkjlkjoiuoklklkfdoidfaerflinks of londonjkljkljioulklopilapdlinks of london braceletdfsapoipoljlkjewr
10/20/2009 2:56 AM | links

# ed hardy shop

1cool dude, wow I already spent many days 10/23/2009 2:43 AM | ed hardy

# re: What??? You deleted "Default Web Site" from IIS?!?!

i am doing a same thing which you describe above. i can do authentication using local user/ administator but not able to connect with a NETWORK SERVICe account. 11/6/2009 8:49 PM | DDos Protection

Post a comment





 

News


Welcome to my blog.
Here's what we've got on the menu today:

Tag Cloud


Article Categories

Archives

Post Categories

Image Galleries

Syndication: