Solved

Script creating a virtual direcotry redirect in iis6?

Posted on 2014-02-10
2
427 Views
Last Modified: 2014-03-12
Hello all

I have a large number of virtual directory redirects to put in place on an IIS 6.0 web server. I'd like to script this to save myself some time clicking a billion times in the interface.

I read an article about creating the virt directory with cscript but don't see how I can create a redirect using this syntax.

I imagine it's something simple I'm missing. Could anybody help?

I'm making redirects like www.mysite.com/AL that should be a virtual directory and redirect to www1.mysite.com/stuff/alaska.htm

Thanks!
0
Comment
Question by:scox72
2 Comments
 
LVL 28

Accepted Solution

by:
becraig earned 500 total points
ID: 39848087
Something like below should work.

cscript.exe adsutil.vbs set w3svc/2/Root/AL/HttpRedirect "www1.mysite.com/stuff/alaska.htm, EXACT_DESTINATION"
0
 

Author Comment

by:scox72
ID: 39923703
Sorry for abandoning this question -- I went on vacation and totally forgot about it.

Here's the essence of what I used, helped by becraig's suggestion above. This sets the virtual directory and the redirect.

iisvdir /creat w3svc/1/root/ diralias c:\inetpub\wwwroot\redirect
adsutil.vbs set w3svc/1/root/diralias/httpredirect "http://www.mysite.com/stuff/alias.htm, EXACT_DESTINATION"

not iisvdir and adsutil.vbs are in different directories on the server c:\windows\system32\ and c:\inetpub\adminscripts respectively.

Thanks agian becraig!
0

Featured Post

Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

Join & Write a Comment

Batch, VBS, and scripts in general are incredibly useful for repetitive tasks.  Some tasks can take a while to complete and it can be annoying to check back only to discover that your script finished 5 minutes ago.  Some scripts may complete nearly …
Lync server 2013 Backup Service Error ID 4049 – After File Share Migration
The viewer will learn how to count occurrences of each item in an array.
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…

746 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

12 Experts available now in Live!

Get 1:1 Help Now