通过appcmd.exe为加载用户配置文件设置IIS配置
我正试图通过使用appcmd.exe的powershell脚本将“加载用户配置文件”的配置设置设置为true。在阅读了许多文档之后,我想不出正确的语法 应用程序池的名称类似于“accountsmanagement.example.com”,我尝试了以下方面的变体,但都出现了错误:通过appcmd.exe为加载用户配置文件设置IIS配置,iis,powershell,appcmd,Iis,Powershell,Appcmd,我正试图通过使用appcmd.exe的powershell脚本将“加载用户配置文件”的配置设置设置为true。在阅读了许多文档之后,我想不出正确的语法 应用程序池的名称类似于“accountsmanagement.example.com”,我尝试了以下方面的变体,但都出现了错误: c:\Windows\system32\inetsrv\appcmd.exe set config -section:applicationPools /accountsmanagement.example.com.p
c:\Windows\system32\inetsrv\appcmd.exe set config -section:applicationPools /accountsmanagement.example.com.processModel.loadUserProfile:true
如何通过appcmd.exe将加载用户配置文件正确设置为true?尝试使用引号
c:\windows\system32\inetsrv\appcmd.exe set config -section:applicationPools "/[name='accountsmanagement.example.com'].processModel.loadUserProfile:false"
除了使用
appcmd.exe set config
之外,还可以使用以下命令
appcmd.exe set apppool "App Pool name here" -processmodel.loaduserprofile:"true"
要显示可设置的所有值,请使用
appcmd.exe set apppool "App Pool name here" /?
如果希望纯粹使用
PowerShell
,可以使用以下PowerShell
命令更改应用程序池的“加载用户配置文件”属性
Import-Module WebAdministration
Set-ItemProperty "IIS:\AppPools\YourAppPoolName" -Name "processModel.loadUserProfile" -Value "False"
对谢谢分享。自Win2008/IIS 7.FYI:WebAdministration module:
进程应具有提升状态才能访问IIS配置数据。
尝试从appcmd.exe设置配置也需要elavation。正如他们应该做的那样,这个答案不是将设置设置为false吗?原来的海报正好相反。太好了!谢谢