我尝试通过运行以下 Cmdlet 使用 PowerShell 将 IIS 应用程序池的 Enable32BitApplication 和 LoadUserProfile 的值设置为 True:
(Get-IISAppPool -Name DefaultAppPool).enable32BitAppOnWin64 = $True
(Get-IISAppPool -Name DefaultAppPool).ProcessModel.LoadUserProfile = $True
当我使用 PowerShell 检索这些值时,看起来 Cmdlet 已成功运行,但是当我尝试在 GUI 中检查它时,我注意到它不起作用。这就是为什么我尝试测试应用程序池网站的原因,我发现这些 Cmdlet 不起作用。任何人都可以帮助我使用正确的 PowerShell Cmdlet 吗?
最佳答案
为了通过修改 Get-IISAppPool
返回的对象使其工作,您必须在更改值之前调用 Start-IISCommitDelay
,然后调用 Stop -IISCommitDelay
进行更改后。所以在你的情况下是:
Start-IISCommitDelay
(Get-IISAppPool -Name DefaultAppPool).enable32BitAppOnWin64 = $True
(Get-IISAppPool -Name DefaultAppPool).ProcessModel.LoadUserProfile = $True
Stop-IISCommitDelay
关于powershell - 使用 PowerShell 配置 IIS 应用程序池设置,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51735286/