Solved

vbs script to change just the IIS home directory

Posted on 2011-02-11
3
711 Views
Last Modified: 2012-05-11
i have many sites that i need to change JUST the home directory on. can anyone help me?
examlpe the site home directory is pointed at f:\test\www and i need them to point to f:\NEW\www
0
Comment
Question by:adamshields
[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
3 Comments
 
LVL 6

Accepted Solution

by:
Raneesh Chitootharayil earned 250 total points
ID: 34876975
0
 
LVL 3

Author Comment

by:adamshields
ID: 34877060
adsutil.vbs set /w3svc/1/root/path f:\NEW\www

works but for only 1 site how do i do all running sites. i am not sure if thats an option
0
 
LVL 3

Assisted Solution

by:sam0x01
sam0x01 earned 250 total points
ID: 34950721
Unsure if this is much help. Best to confirm you are running IIS6.

I looked at this with interest as I never have tried to interact with IIS settings with a script.

From what research I have done, the property accessible via ADSI and WMI is AppRoot.

Unfortunately Microsoft have published "Because this property is internally configured by IIS, you should consider it to be read-only. Do not configure this property."

Additional advice of
"Use the application management methods of the IIsWebVirtualDir and IIsWebDirectory objects."

From looking at these classes, there does not appear to be a method to change the AppRoot property.

By the looks of it MS has engineered these objects it appears that deletion and recreation of the object with the new path is required.

May be possible to do this with the .NET Framework through Powershell. I am not sure how IIS 6 works with its metabase. I remember a binary, but was of the impression there was a way to get an xml file. Perhaps this could be parsed with a script or text editor (find/replace).
0

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
HTTP to HTTPS but have 2 sub sites 8 38
Collapse and expand table in Word 2010 2 103
IIS 8.0 and Kemp Load Master 1 24
IIS Authentication Error 401 16 17
Deploying a Microsoft Access application in a Citrix environment is not difficult but takes a few steps. However, Citrix system people are often of little help, as they typically know next to nothing about Access. The script provided here will take …
ADCs have gained traction within the last decade, largely due to increased demand for legacy load balancing appliances to handle more advanced application delivery requirements and improve application performance.
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…
Are you ready to implement Active Directory best practices without reading 300+ pages? You're in luck. In this webinar hosted by Skyport Systems, you gain insight into Microsoft's latest comprehensive guide, with tips on the best and easiest way…

726 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