views:

92

answers:

1

I have IIS installed on a server configured with asp.net 2.0 and a directory located at C:/Inetpub/wwwroot/application. I also got an automated process for zipping up an asp.net web application, scp'ing that .zip file to said server, blowing away the previous contents of the application/ directory, and unzipping the .zip file there, and making appropriate changes to web.config. It works great in all cases but one.

If I'm dealing with a fresh windows image that I've been given, I have to manually Remote Desktop in to that machine, open the IIS management console, right click on the application/ directory, click Properties, and on the Directory tab, and under Application settings click the Create button.

This is great and convenient at all, except that I'd like to fully automate the process so I can do it completely headless from start to finish each time. I looked at some various scripts that are apparently available for IIS administration, but I didn't see anything that would let me manipulate a directory in such away.

Two questions:

1) How would one do this to a directory through the command line instead of through dialog boxes

2) What exactly does "Create"'ing an application mean in this case to IIS. That the ASP.NET worker process just has permission to execute in this directory?

Thanks in advance.

+1  A: 

If you create a VBS file, this should help you create a virtual dir

'Using IIS Administration object , turn on script/execute permissions and define the virtual directory as an 'in-process application. 
Set objIIS  = GetObject( "IIS://localhost/W3SVC/1/Root" )
Set vDirObj = objIIS.Create( "IISWebVirtualDir", vDirName )

vDirObj.Path                  = vDirPath
vDirObj.AuthNTLM              = True
vDirObj.AccessRead            = True
vDirObj.AccessWrite           = True 
vDirObj.AccessScript          = True
vDirObj.AccessExecute         = True
vDirObj.AuthAnonymous         = True
vDirObj.AnonymousPasswordSync = True
vDirObj.EnableDefaultDoc = True
vDirObj.DefaultDoc = "default.aspx"
vDirObj.AppCreate True
vDirObj.SetInfo
pb