Solved

vbs script to change just the IIS home directory

Posted on 2011-02-11
3
713 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

This article is the result of a quest to better understand Task Scheduler 2.0 and all the newer objects available in vbscript in this version over  the limited options we had scripting in Task Scheduler 1.0.  As I started my journey of knowledge I f…
With User Account Control (UAC) enabled in Windows 7, one needs to open an elevated Command Prompt in order to run scripts under administrative privileges. Although the elevated Command Prompt accomplishes the task, the question How to run as script…
Monitoring a network: why having a policy is the best policy? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the enormous benefits of having a policy-based approach when monitoring medium and large networks. Software utilized in this v…
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …

724 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