Solved

vbs script to change just the IIS home directory

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

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

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…
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.
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…

757 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

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now