IIS 7 and Above
Last post Jul 08, 2008 08:29 AM by rsiddaw
Jul 07, 2008 02:50 PM|rsiddaw|LINK
I can't see a way to link an application pool to an application. is there a cmdlet to do this?
Jul 08, 2008 02:57 AM|sergeia|LINK
You have to set property applicationPool on application object to the name of pool you want to handle this app. If you want to do this for a site, strictly speaking, you have to do this for the root application, but
in our namespace we hide root applications and site objects have this property mapped from their root applications, so you could set it on site.
It is pretty simple and we decided not to make a separate cmdlet for this. There is no explicit connection from application pool to an application, what you see in output in Applications column is result of script block
execution query that is defined as script property for application pool view. So to add application to the app pool run:
set-itemproperty iis:\sites\yourSite\yourAppName -name applicationPool -value yourPool
set-itemproperty iis:\sites\yourSite -name applicationPool -value yourPool
Replace "iis:\sites\yourSite" or "iis:\sites\yourSite\yourAppName" by the path to your site or to your application, and "yourPool" by the name of your target application pool.
Jul 08, 2008 03:26 AM|rsiddaw|LINK
Thank you for the reply. I was hoping that it could be done directly via cmdlet. I think from the user experience that it would make more sense
Jul 08, 2008 03:55 AM|sergeia|LINK
Well, we have more than hundred schematized collections in configuration. We could create enough specific cmdlets to cover all various kinds of data, but it will be at least three hundred commands with different parameters for get/set/new operations, then
unknown number of commands for more specific operations like setting app to app pool. I doubt users will be happy with this amount of commands. Therefore we decided to be conservative for now and limit number of helper commands to the bare minimum, as we understand
it. We are looking for users feedback to decide, is it right set of commands, or it should be extended/changed.
We expect that little by little customers will start using standard commands from provider. As soon as you are familiar with namespace path, you could easily figure out the path to any object you want, you could navigate to this location and do various things
without passing path to commands, or passing dot, just like in file system provider, or in the registry provider. You also using the same commands: get-item, set-item, get-itemproperty, etc. This is whole idea of providers in PowerShell: limit number of commands
you have to memorize.
Jul 08, 2008 08:29 AM|rsiddaw|LINK
I can see the logiv in that. Would it be possible to add a parameter to new-AppPool so that when it was created you could specify the application or site that was going to use it.