?
Solved

i need a VBscript to return site ID and set UseHostName= true

Posted on 2010-01-11
1
Medium Priority
?
918 Views
Last Modified: 2012-05-08
cscript adsutil.vbs set w3svc/x/UseHostName true I know this part but how can I get a script to pass X to this , I want X to be the SITE IDENTIFIER on the web site

I want to scan a IIS and comeup with the SITE IDENTIFER and then set the usehostname to true in the metabase for each website ,how

I am a beginner at scripting
0
Comment
Question by:NAMEWITHELD12
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 13

Accepted Solution

by:
Springy555 earned 2000 total points
ID: 26292144
You can do this with 2 scripts:

FIRST:
siteid.vbs will extract the site id for each website on the server, and place them in a text file at c:\siteid.txt.  

Open up a cmd prompt window, and run the script by typing:
cscript siteid.vbs


SECOND:
***rename siteid.txt to siteid.bat***
siteid.bat will use the siteid's in siteid.txt and set UseHostName true for each of them.  
*You must copy adsutil.vbs into the same directory as you place siteid.bat!!!*
You can find adsutil.vbs probably under C:\Inetpub\AdminScripts, although you may need to search your machine to find it.

Open up a cmd prompt window, and run the script by typing:
siteid.bat

Scripts attached below.

Remember to backup the IIS metabase first!!!!
siteid.vbs
siteid.txt
0

Featured Post

Get proactive database performance tuning online

At Percona’s web store you can order full Percona Database Performance Audit in minutes. Find out the health of your database, and how to improve it. Pay online with a credit card. Improve your database performance now!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Prologue It is often required to host multiple websites on a single instance of IIS, mostly in development environments instead of on production servers. I am sure it is not much a preferred solution on production servers but this is at least a pos…
Lease-to-own eliminates the expenditure of hardware replacement and allows you to pay off the server over time. Usually, this is much cheaper than leasing servers. Think of lease-to-own as credit without interest.
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…
In this video, Percona Solution Engineer Rick Golba discuss how (and why) you implement high availability in a database environment. To discuss how Percona Consulting can help with your design and architecture needs for your database and infrastr…

800 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question