Get / Set IIS Property at W3VC and W3SVC/AppPools levels

For all your non-technical questions.
andrereg
Posts: 15
Joined: Tue Oct 24, 2006 3:43 pm
Contact:

Get / Set IIS Property at W3VC and W3SVC/AppPools levels

Postby andrereg » Tue Oct 24, 2006 4:11 pm

Hi,

We are doing a proof-of-concept installation package using a trial version (InstallAware 6.0) to make sure the software can do everything we need before purchasing it.

As part of our install, I need to do two things:
1. READ the value of IIS metabase property at W3SVC/IIs5IsolationModeEnabled
As you probably know, IIS 6.0 behaves radically different based on this setting and i need to know its value in order to do the install.
(see http://msdn.microsoft.com/library/defau ... erview.asp)

2. SET the value of IIS metabase properties at W3SVC/AppPools/MyAppPool/[WAMUserName/WAMUserPass]
I've got 2 Virtual Directories that my IA package creates and sets to a custom ApplicationPool like "MyAppPool"
One of my installation options is to use a specified account for the application pool.

---

Solution Questions:
1'. Does the built-in script command "Get IIS Property" support this?
I've *tried* a solution using the following.
(cscript //Nologo C:\\Inetpub\\AdminScripts\\adsutil.vbs GET W3SVC/IIs5IsolationModeEnabled > "%TEMP%\\output.txt")
Note: this command writes the value of the metabase property out to a temp file.
BUT, when i tried to convert this into a "Run Program" command, piping the output does not work.
Run Program: "cscript"
Parameters: //Nologo C:\\Inetpub\\AdminScripts\\adsutil.vbs GET W3SVC/IIs5IsolationModeEnabled > "%TEMP%\\output.txt"

Why does this behave differently when run from "Run Program" in InstallAware?


2'. Does the built-in script command "Set IIS Property" support doing this?
I've found a solution for this that doesn't require a plugin:
(cscript C:\\Inetpub\\AdminScripts\\adsutil.vbs SET W3SVC/AppPools/MyAppPool/WAMUserName domain\\user)
but, it adds a dependency on an adminscript, which seems undesirable -- I'd prefer to use the built-ins if possible.

Plugins are always a possibility for getting work done that isn't supported via the built-in scripting commands, but keeping it simple would be ideal.

It seems many besides myself would need to deal with these properties in IIS -- is there a possibility that there would be built-in commands to deal with IIS Application Pools soon?

thanks,
drew

CandiceJones
Posts: 904
Joined: Thu Dec 22, 2005 7:03 pm
Contact:

Postby CandiceJones » Tue Oct 24, 2006 6:18 pm

1. The easiest way to find out is just to try the command and see the value it returns :) I am not an IIS metabase expert so I don't know offhand, but if its a plain property (i.e. not an array or similar), it should work.

The piping won't work, because that is actually handled by the cmd.exe command line interpreter. Running an application does not ordinarily provide a way to pipe its output, this has to be done manually, and its a feature built into cmd.exe. You can do this by running cmd.exe itself, and supplying the program you wish to run and the pipe as parameters.

2. Again, just give it a try. Will work if its a simple property.

Thanks for suggesting these as built-in features - I will log these with the product managers.
Candice Jones
InstallAware
Home of The Next Generation MSI Installer
Get your free copy today - http://www.installaware.com/

andrereg
Posts: 15
Joined: Tue Oct 24, 2006 3:43 pm
Contact:

Postby andrereg » Wed Oct 25, 2006 9:07 am

Hi Candice,

thanks so much for your reply.

<cmd.exe piping>
It seems like this suggestion ought to work; however it still doesn't pipe the output correctly.

Sample call from a command shell:
cmd /C echo "Hello World" > %TEMP%\\file.log

Sample converted into an InstallAware "Run Program" script line:
Run Program: cmd
Working Directory: empty
Command Line Parameters: /C echo "Hello World" > %TEMP%\\file.log

The latter does not pipe any output into the designated file. Have i converted it to a call to "cmd" correctly as you suggested?
Please let me know if there is a way to adjust this scripting call so that it does.

<IIS Metabase Properties>
Sorry i didn't state the question more clearly.
IIS Metabase properties are organized in a tree structure similar to the following:
    W3SVC (this level contains the "IIs5IsolationModeEnabled" key)
      1 (default website - contains a "KeyType" key)
        ROOT
          Virtual Directory 1
          Virtual Directory 2
      AppPools
        DefaultAppPool
        MyAppPool (this level contains WAMUserName and WAMUserPass keys)


The built-in command "Get IIS Property" has two radio buttons at the top,
"Web Site" or "Virtual Folder". The IIS Property i need to access is NOT relevant to a web site OR a virtual folder-- it is higher in the tree than that.

To re-state the question (hopefully with more clarity),
I can access key "KeyType" above using these settings:
Get IIS Property,
"Web Site" Radio button = checked
"Site Index" = 1
"Get Property" Name = "KeyType"

"What settings would i need to enter for the IIS Get Property command in order to access the key at "W3SVC\\IIs5IsolationModeEnabled?".

thanks again!
drew

CandiceJones
Posts: 904
Joined: Thu Dec 22, 2005 7:03 pm
Contact:

Postby CandiceJones » Wed Oct 25, 2006 10:45 am

Hi Drew,

It sounds like you may need to write a custom EXE or DLL or full-blown IDE plug-in to take care of this, based on your report.
Candice Jones

InstallAware

Home of The Next Generation MSI Installer

Get your free copy today - http://www.installaware.com/

andrereg
Posts: 15
Joined: Tue Oct 24, 2006 3:43 pm
Contact:

Postby andrereg » Thu Nov 02, 2006 10:50 am

<cmd.exe piping>

The reason piping was not working for me was that there was a bug in the "Run Program As" command that caused it to have a near-empty set of environment variables such that the "echo" command was not found.

See http://forums.installaware.com/viewtopic.php?t=1283 for details
Topic: "Run Program As - Environment parameter questions"

After getting that bug fix, i was able to do everything i needed to do using adsutil.vbs and scripting -- no plugins were necessary. :)


Return to “Non-Technical”

Who is online

Users browsing this forum: No registered users and 32 guests