Solved

vbs script to change just the IIS home directory

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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

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

Suggested Solutions

If you don't have the right permissions set for your WordPress location in IIS, you won't be able to perform automatic updates. Here's how to fix the problem.
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 …
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…
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…

832 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