[英]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.