powershell - 使用 PowerShell 配置 IIS 应用程序池设置

标签 powershell iis

我尝试通过运行以下 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/

相关文章:

Powershell Echo 语句 + 一行变量

windows - 如何在 Windows Server 2016 上为托管服务器安装 Web Deploy

sql-server - 使用 VB.NET 后端编写网站,无需 ASP.NET

c# - MVC : File. 存在返回 false

python - 在用户数据中将 powershell 脚本发送到 Windows ec2

ruby - 如何使用 Chef 脚本安装 Windows 服务

powershell - 是否有等待 "break"从 powershell 中的 Get-Content 等待循环?

powershell - 删除数组重复项,但保留原始

asp.net - 多个域的集成 Windows 身份验证

iis - ASP.NET Core 无法在 IIS 下运行 : HTTP Error 500. 0 - ANCM In-Process Handler Load Failure