• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 940
  • Last Modified:

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

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
NAMEWITHELD12
Asked:
NAMEWITHELD12
1 Solution
 
Springy555Commented:
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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now