[Last Call] Learn about multicloud storage options and how to improve your company's cloud strategy. Register Now

x
?
Solved

vbs script to change just the IIS home directory

Posted on 2011-02-11
3
Medium Priority
?
715 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 1000 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 1000 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

[Webinar] Lessons on Recovering from Petya

Skyport is working hard to help customers recover from recent attacks, like the Petya worm. This work has brought to light some important lessons. New malware attacks like this can take down your entire environment. Learn from others mistakes on how to prevent Petya like worms.

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…
When you see single cell contains number and text, and you have to get any date out of it seems like cracking our heads.
In this video, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster. To discuss how Percona Consulting can help with your design and architecture needs for your database and infras…
In this video, Percona Solutions Engineer Barrett Chambers discusses some of the basic syntax differences between MySQL and MongoDB. To learn more check out our webinar on MongoDB administration for MySQL DBA: https://www.percona.com/resources/we…
Suggested Courses

650 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