cescentman
asked on
Creating Virtual Directories by script or XML file
I need to create a large number of virtual directories and am looking for a way of either automating or speeding up the process. The virtual directories have a more complex config including a username and password to allow access to a share and setting permission on it. Consequently Iisvdir.vbs that ships with windows does not fit the bill as it leaves a number of tasks undone. I notice that it is possible to create virtual directories from an XML file so my question is can anyone either:-
Point me to a script that would give me total control of the creation process.
Or
If the XML control file would fit the bill, point me in the direction of how to create such a file.
Point me to a script that would give me total control of the creation process.
Or
If the XML control file would fit the bill, point me in the direction of how to create such a file.
Some simple and easy examples here as well :
http://techtasks.com/code/viewbookcode/696
http://msdn.microsoft.com/en-us/library/ms524830.aspx
http://techtasks.com/code/viewbookcode/696
http://msdn.microsoft.com/en-us/library/ms524830.aspx
ASKER
Thanks both for the suggestions. There is a wealth of information here but I can't see any details on how I add the username and password via the scripts.
ASKER
Should I abandon this or does anyone have any suggestions?
Hi,
to set access credentials on any path, you need to set credentials via ntfs permissions on the physical location/s. Once you have done that, simply disable anonymous access to the virtual dir, and then that path will require login.
If you want to also script the credentials, then you will either need something to work with ntfs permissions, or else use some kind of ISAPI-auth, something like this one:
http://www.codeproject.com/KB/ISAPI/authfilter.aspx
cheers.
to set access credentials on any path, you need to set credentials via ntfs permissions on the physical location/s. Once you have done that, simply disable anonymous access to the virtual dir, and then that path will require login.
If you want to also script the credentials, then you will either need something to work with ntfs permissions, or else use some kind of ISAPI-auth, something like this one:
http://www.codeproject.com/KB/ISAPI/authfilter.aspx
cheers.
ASKER
Thanks for the suggestion but this doesn't really bear on the issue, NTFS permissions are already set. When setting up the virtual directory I need to set a user name and password for the user that has access to the particular share. In addition to that I also need to set the permisiins on the IIS virtual folder object.
Are you referring to anonymous web user?
That is done using "AnonymousUserName" and "AnonymousUserPass" parameters to adsutil.vbs, e.g:
e.g. create the virtual dir:
c:\inetpub\adsutil.vbs CREATE W3SVC/1/Root/MyVdir "IIsWebVirtualDir"
set the path:
c:\inetpub\adsutil.vbs SET W3SVC/1/Root/MyVdir/Path "C:\path\path"
Set the anonymous credentials:
c:\inetpub\adsutil.vbs SET W3SVC/1/Root/MyVdir/Path/A nonymousUs ername "someuser"
c:\inetpub\adsutil.vbs SET W3SVC/1/Root/MyVdir/Path/A nonymousUs ername "somepassword"
Cheers.
That is done using "AnonymousUserName" and "AnonymousUserPass" parameters to adsutil.vbs, e.g:
e.g. create the virtual dir:
c:\inetpub\adsutil.vbs CREATE W3SVC/1/Root/MyVdir "IIsWebVirtualDir"
set the path:
c:\inetpub\adsutil.vbs SET W3SVC/1/Root/MyVdir/Path "C:\path\path"
Set the anonymous credentials:
c:\inetpub\adsutil.vbs SET W3SVC/1/Root/MyVdir/Path/A
c:\inetpub\adsutil.vbs SET W3SVC/1/Root/MyVdir/Path/A
Cheers.
ASKER
Maybe that's what has confused me. In the IIS snapin under virtual directory there is the "Connect As..." button is that the same as the "AnonymousUsername" ?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
OK thanks I'll give it a try.
if you are going to give a B grade, then at least you should give a reason.
cheers.
cheers.
take a look at [installdrive]:/inetpub/ad
just run "cscript.exe \inetpub\adminscripts\adsu
Cheers.