App Pool advanced settings using Powershell Desired Configuration State

北慕城南 提交于 2019-12-05 18:24:01

问题


How can I modify various settings inside either a new or exisitng App Pool using Powershell?

I am interesting in some of the "Advanced" settings such as Enable 32-Bit Applications, Managed Pipeline Mode, Process Model Identity, etc. Any ideas on how I can do this? I tried using the xWebAdministration module but that seems to have very basic settings.


回答1:


Yes, a custom DSC resource is the only way to do this with DSC. If you are able to use PowerShell scripting without DSC, you can use the WebAdministration module module to create the pool, and then modify it from there.

$appPoolName = "MyAppPool"
New-WebAppPool -Name $appPoolName
$appPool = Get-Item "IIS:\AppPools\$appPoolName"
$appPool.processModel.identityType = 3
$appPool.processModel.username = "someUser"
$appPool.processModel.password = "somePassword"
$appPool.managedRuntimeVersion = "v4.0"
$appPool.managedPipeLineMode = "Integrated"

Update 1/31/2015

In the PowerShell.org community DSC modules, someone made a cWebAdministration pull request that apparently includes "37 app pool config options". Might be a great solution.




回答2:


You need to write your own custom DSC resource for doing that.

This is a good starting point.

However, I recommend that you take a look at Script resource to build the logic required for all three functions in a DSC resource and experiment before writing a resource.



来源:https://stackoverflow.com/questions/25089210/app-pool-advanced-settings-using-powershell-desired-configuration-state

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!