Geeks With Blogs

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

Lorin Thwaits A geek says what?

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. Posted on Friday, December 9, 2005 8:18 PM ASP.NET | Back to top


Comments on this post: What??? You deleted "Default Web Site" from IIS?!?!

# re: What??? You deleted "Default Web Site" from IIS?!?!
Requesting Gravatar...
Great,
Thanks a lot 4 this topic! It helped me with instaling TFS =)
Left by Marius on Sep 29, 2006 1:15 AM

# re: What??? You deleted "Default Web Site" from IIS?!?!
Requesting Gravatar...
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.
Left by Martin Robb on Mar 07, 2007 8:29 AM

# re: What??? You deleted "Default Web Site" from IIS?!?!
Requesting Gravatar...
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.
Left by Mr. Anderson on Sep 27, 2007 5:43 AM

# re: What??? You deleted "Default Web Site" from IIS?!?!
Requesting Gravatar...
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?
Left by Jerry on Oct 29, 2007 2:27 AM

# re: What??? You deleted "Default Web Site" from IIS?!?!
Requesting Gravatar...
Error trying to get the object: w3svc

can u help ???

IIS 5
Left by Jank on Nov 15, 2007 6:27 PM

# re: What??? You deleted "Default Web Site" from IIS?!?!
Requesting Gravatar...
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!!!
Left by rohit on Dec 13, 2007 8:30 PM

# You saved our butts!
Requesting Gravatar...
You rock! We had a scary deadline, an app that wouldn't install, and a missing website. This worked perfect!
Left by coruscate on Mar 13, 2008 4:19 PM

# re: What??? You deleted "Default Web Site" from IIS?!?!
Requesting Gravatar...
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.
Left by tim on Mar 21, 2008 8:01 AM

# re: What??? You deleted "Default Web Site" from IIS?!?!
Requesting Gravatar...
thanks ,its really helped me ,i thought i had to reinstall the IIS but the info really helped me.
Left by kcsekhar13 on Jun 17, 2008 1:10 AM

# re: What??? You deleted "Default Web Site" from IIS?!?!
Requesting Gravatar...
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?
Left by Dav on Jul 24, 2008 5:19 AM

# re: What??? You deleted "Default Web Site" from IIS?!?!
Requesting Gravatar...
You are wonderfull!
Left by Giovana on Aug 05, 2008 1:19 AM

# re: What??? You deleted "Default Web Site" from IIS?!?!
Requesting Gravatar...
Thank you!! Thank you!! Thank you!!
Left by # on Sep 24, 2008 4:20 AM

# re: What??? You deleted "Default Web Site" from IIS?!?!
Requesting Gravatar...
Thanks mang! Awesomeness!
Left by prezz0r on Jan 12, 2009 6:36 AM

# re: What??? You deleted "Default Web Site" from IIS?!?!
Requesting Gravatar...
Exactly what I was looking for but couldn't find... until now! Thank you Lorin!
Left by JP on Mar 30, 2009 8:31 AM

# re: What??? You deleted "Default Web Site" from IIS?!?!
Requesting Gravatar...
Amazing! Its a miracle.
Left by Roman on Apr 23, 2009 10:29 PM

# re: What??? You deleted "Default Web Site" from IIS?!?!
Requesting Gravatar...
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.
Left by Anonymous on Jun 03, 2009 7:48 AM

# re: What??? You deleted "Default Web Site" from IIS?!?!
Requesting Gravatar...
reporting services wouldn't install without this fix.
Left by driver scan online on Jul 04, 2009 11:33 PM

# re: What??? You deleted "Default Web Site" from IIS?!?!
Requesting Gravatar...
Thank you! Thnk you! Thank you!
Left by Erica on Jul 31, 2009 5:26 AM

# re: What??? You deleted "Default Web Site" from IIS?!?!
Requesting Gravatar...
Thank you very much. Very helpful.
Left by Fabio on Aug 18, 2009 11:07 AM

# re: What??? You deleted "Default Web Site" from IIS?!?!
Requesting Gravatar...
Great article. I did not know at first what to expect form the title of this post. Thanks.
Rehabs
Left by Gerry on Oct 16, 2009 4:38 AM

# re: What??? You deleted "Default Web Site" from IIS?!?!
Requesting Gravatar...
I did not know at first what to expect form
Left by Tiffany co Necklaces on Oct 17, 2009 11:57 PM

# re: What??? You deleted "Default Web Site" from IIS?!?!
Requesting Gravatar...
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.
Left by DDos Protection on Nov 06, 2009 8:49 PM

# re: What??? You deleted "Default Web Site" from IIS?!?!
Requesting Gravatar...
Re. >>>I have an easier way...

Well, I have browsed to: "\WINDOWS\System32\inetsrv\History" and found only 20 files there and all of them dated either 5/7/2006 or 11/27/2009 with exception of one. None of them contained "Default Web Site" in its lists.

I guess your tip might have worked if configuration history existed for Default Web Site, but it didn't, and I have deleted default website a few years ago. So, I have "restored" it by using instructions above. The only question I have is, why would I need to copy another website rather than to right-click on Web Sites folder and then choose "new website" and name it "Default Web Site", and then make/change it to W3SVC/1 or whatever? Or… maybe I don’t know what I am talking about… if I knew, I wouldn’t be here :)
Left by leo on Nov 28, 2009 12:53 AM

# re: What??? You deleted "Default Web Site" from IIS?!?!
Requesting Gravatar...
That was a nice post. I thought it was something in context to the title! You had me there buddy :)
Gerry
Left by funny t shirt on Dec 04, 2009 11:25 AM

# re: What??? You deleted "Default Web Site" from IIS?!?!
Requesting Gravatar...
Hahaha! Thanks for that witty title mate!
Left by fashion boots on Dec 27, 2009 5:22 AM

# re: What??? You deleted "Default Web Site" from IIS?!?!
Requesting Gravatar...
thanks for the information
Left by memory power on Dec 28, 2009 12:24 AM

# re: What??? You deleted "Default Web Site" from IIS?!?!
Requesting Gravatar...
You are genius mate! It worked absolutely perfect. You saved my time and life buddy.
Left by Ali on Jan 13, 2010 8:55 PM

# re: What??? You deleted "Default Web Site" from IIS?!?!
Requesting Gravatar...
thank you for your sharing, Nice post here. It does make senses, appreciate for sharing.
Left by tina on Jan 18, 2010 6:53 PM

# re: What??? You deleted "Default Web Site" from IIS?!?!
Requesting Gravatar...
Thanks for your sharing.wish you have a lovely day and Happy New Year.
MBT shoes
Cheap MBT shoes
Left by ella on Jan 28, 2010 2:30 AM

# The Tears of Dragonfly
Requesting Gravatar...
The boy and girl are lovers in love. Unfortunately,links of london the girl fell in a gymnastics competition. The doctor diagnosed as: leukemia.
The bay companied the girl everyday. Watching the girl’s pale face,links of london jewellery the boy wept. He wept very sad. He sat besides the girl every night and began to fold The Paper Crane. Thus a few months passed.
Left by caoshuye888 on Feb 20, 2010 12:45 AM

# links of london
Requesting Gravatar...
The boy and girl are lovers in love. Unfortunately, the girl fell in a gymnastics competition. The doctor diagnosedlinks of london as: leukemia.
The bay companied the girl everyday. Watching the girl’s pale face, the boy wept. He wept very sad. He sat besides the girl every night and
began to fold The Paper Crane. Thus a few months passed. The girl is at her last gasp and unconscious all the time. The boy still folded the
paper crane for her day by day. When he folded the 1000th,links of london jewellery the room was lighted; an angel suddenly appeared in front of the boy. The boy was
petrified, rubbing his red eyes, holding the girl’s hand and cried to the angel, “Please help this kindhearted girl” the angel said to the
boy, “if you like, could you be a dragonfly for 3 years, the girl will be better day by day slowly” the boy promised with no hesitated.
The angel disappeared and the boy became a dragonfly at the same time.
Left by haio200 on Feb 26, 2010 12:57 AM

# links of london
Requesting Gravatar...
The boy and girl are lovers in love. Unfortunately, the girl fell in a gymnastics competition. The doctor diagnosedlinks of london as: leukemia.
The bay companied the girl everyday. Watching the girl’s pale face, the boy wept. He wept very sad. He sat besides the girl every night and
began to fold The Paper Crane. Thus a few months passed. The girl is at her last gasp and unconscious all the time. The boy still folded the
paper crane for her day by day. When he folded the 1000th,links of london jewellery the room was lighted; an angel suddenly appeared in front of the boy. The boy was
petrified, rubbing his red eyes, holding the girl’s hand and cried to the angel, “Please help this kindhearted girl” the angel said to the
boy, “if you like, could you be a dragonfly for 3 years, the girl will be better day by day slowly” the boy promised with no hesitated.
The angel disappeared and the boy became a dragonfly at the same time.
Left by haio200 on Feb 27, 2010 1:44 AM

# re: What??? You deleted "Default Web Site" from IIS?!?!
Requesting Gravatar...
Well thats quite informative thanks!
Left by Buy Extenze on Jul 20, 2010 1:58 AM

# Hello
Requesting Gravatar...
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.
Left by P90X Workout Program on Jul 20, 2010 3:31 AM

# re: What??? You deleted "Default Web Site" from IIS?!?!
Requesting Gravatar...
i have deleted some files but i dont have any idea about this default web site. it will be helpfull for those who came loging on to net for searching.



craigslist tampa
Left by craigslist tampa on Jul 28, 2010 4:50 AM

# re: What??? You deleted "Default Web Site" from IIS?!?!
Requesting Gravatar...
i have deleted some files because i don,t have idea about this default web side;it will be helpfull for those who person on to net for searching.because the iis file is the default web side.
craigslist san diego
Left by asif javed on Jul 28, 2010 5:50 AM

# re: What??? You deleted "Default Web Site" from IIS?!?!
Requesting Gravatar...
I brought a coach handbag last week,i like it very much,now i share you linkDiscount Gucci handbags,Discount Coach handbags
Left by Discount Gucci handbags on Jul 29, 2010 10:27 PM

# re: What??? You deleted "Default Web Site" from IIS?!?!
Requesting Gravatar...
In the cold winter, if you want to have a good sleep, Moncler knows what to do for that.Discount Moncler jackets,Discount Moncler T-shirts Looking here!
Left by Discount Moncler jackets on Jul 30, 2010 9:38 PM

# Nice information
Requesting Gravatar...
Nice blog: Very useful information is given to us in this article. Your efforts are acknowledgeable and appreciatory. Keep on doing this. Thanx




Listings
Left by listing on Aug 02, 2010 1:09 AM

# re: What??? You deleted "Default Web Site" from IIS?!?!
Requesting Gravatar...
Here provide Discount Moncler jackets,Discount Moncler T-shirts with amazing discount price, and it promised free shipping all over the world also you can choose other express delivery, paypal accepted. you can trust Moncler, it won't let you down.
Left by Discount Moncler jackets on Aug 14, 2010 2:38 AM

# re: What??? You deleted "Default Web Site" from IIS?!?!
Requesting Gravatar...
Thanks for your code.
Left by warts home remedies on Aug 16, 2010 8:51 AM

# re: What??? You deleted "Default Web Site" from IIS?!?!
Requesting Gravatar...
I have always been reading and writing texts like this in blogs. Also, I, as a daily writer, present my respects to everyone. I just watched videos like this in re
Left by cheap insanity on Aug 24, 2010 9:24 PM

Your comment:
 (will show your gravatar)


Copyright © Lorin Thwaits | Powered by: GeeksWithBlogs.net