[英]Setting IIS config via appcmd.exe for Load User Profile
我试图通过使用appcmd.exe的powershell脚本将“加载用户配置文件”的配置设置为true。 阅读了很多文档后,我无法弄清楚正确的语法。
应用程序池的名称就像'accountsmanagement.example.com'我尝试了以下变体,但所有错误都出现了:
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"
如果要纯粹使用PowerShell
,可以使用以下PowerShell
命令更改应用程序池的“加载用户配置文件”属性。
Import-Module WebAdministration
Set-ItemProperty "IIS:\AppPools\YourAppPoolName" -Name "processModel.loadUserProfile" -Value "False"
您也可以使用以下内容,而不是使用appcmd.exe set config
appcmd.exe set apppool "App Pool name here" -processmodel.loaduserprofile:"true"
显示可以设置的所有值
appcmd.exe set apppool "App Pool name here" /?
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.