This website uses cookies. By clicking Accept, you consent to the use of cookies. Click Here to learn more about how we use cookies.
Turn on suggestions
Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.
- Revenera Community
- :
- InstallShield
- :
- InstallShield Forum
- :
- How do I set the AppPool Identity via script for Vista or 2008 Server IIS 7
Subscribe
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Subscribe
- Mute
- Printer Friendly Page
![](/skins/images/8CE4FAD0DE6F3A6F9D0567434D2D2DAE/responsive_peak/images/icon_anonymous_message.png)
Not applicable
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎May 14, 2009
01:23 PM
How do I set the AppPool Identity via script for Vista or 2008 Server IIS 7
I have an InstallScript project that was setting the AppPool identity for IIS 6 by using the IIS Object.
set objAppPools = CoGetObject("IIS://localhost/W3SVC/AppPools", "" );
However that does not seem to work under Vista / Windows Server 2008 and IIS7.
Is there a way to get the object to work or another way to do it? Maybe by setting the AppPool table Username/Password properties via script. If so an example would be appreciated.
set objAppPools = CoGetObject("IIS://localhost/W3SVC/AppPools", "" );
However that does not seem to work under Vista / Windows Server 2008 and IIS7.
Is there a way to get the object to work or another way to do it? Maybe by setting the AppPool table Username/Password properties via script. If so an example would be appreciated.
(5) Replies
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎May 14, 2009
02:59 PM
There may be several answers to your question, but I'll go ahead and post what we did in case it is helpful.
We used the IIS7 Administration Pack (Reference: http://blogs.iis.net/bills/archive/2008/06/01/how-do-i-script-automate-iis7-configuration.aspx) to automatically generate example script, which we then modified to do the job. You can export as javascript, which can be used in a jscript custom action.
The generated script will contain hard-coded values which you'd need to replace with properties from the Windows Installer session
The script generated would only work with IIS7, so you'd need to ensure it was conditioned to only run in that case.
We used the IIS7 Administration Pack (Reference: http://blogs.iis.net/bills/archive/2008/06/01/how-do-i-script-automate-iis7-configuration.aspx) to automatically generate example script, which we then modified to do the job. You can export as javascript, which can be used in a jscript custom action.
The generated script will contain hard-coded values which you'd need to replace with properties from the Windows Installer session
Session.Property("PROPERTYNAME")
The script generated would only work with IIS7, so you'd need to ensure it was conditioned to only run in that case.
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎May 14, 2009
05:48 PM
If you make sure, the IIS6 Management Compatibility for IIS7 is switched on, your script should work without problems. You can check via script if this is turned in the regdb: HKLM\SOFTWARE\\Microsoft\\InetStp\\Components:Metabase must be set to 1.
Hope this helps
Marsyas
Hope this helps
Marsyas
![](/skins/images/8CE4FAD0DE6F3A6F9D0567434D2D2DAE/responsive_peak/images/icon_anonymous_message.png)
Not applicable
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎May 15, 2009
11:40 AM
Thanks for your replies. I found an easy way to set the AppPool Identity in script for IIS 7 using AppCmd.exe.
LaunchAppAndWait (WINSYSDIR ^ "inetsrv\\appcmd.exe", "set config -section:system.applicationHost/applicationPools /[name='MyAppPool'].processModel.userName:\"" + szAppPoolIdentity + " \" /[name='MyAppPool'].processModel.password:\"" + szAppPoolPassword + "\" /commit:apphost", LAAW_OPTION_WAIT | LAAW_OPTION_HIDDEN );
LaunchAppAndWait (WINSYSDIR ^ "inetsrv\\appcmd.exe", "set config -section:system.applicationHost/applicationPools /[name='MyAppPool'].processModel.userName:\"" + szAppPoolIdentity + " \" /[name='MyAppPool'].processModel.password:\"" + szAppPoolPassword + "\" /commit:apphost", LAAW_OPTION_WAIT | LAAW_OPTION_HIDDEN );
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Jun 18, 2009
10:53 PM
Is there any way/scripts to set pipeline mode in IIS7 (Integrated/Classic)? Thanks. 😉
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Jun 18, 2009
11:01 PM
I'm not sure whether there's a way to do that through script; perhaps someone else knows of a way, and they can provide a suggestion. I just wanted to point out that InstallShield 2010 has a new Managed Pipeline Mode setting that lets you specify the appropriate request-processing pipeline mode (integrated or classic) for an application pool.
![](/skins/images/8CE4FAD0DE6F3A6F9D0567434D2D2DAE/responsive_peak/images/icon_anonymous_message.png)