2013-03-14 862 views
10

我試圖通過使用appcmd.exe的PowerShell腳本將「加載用戶配置文件」的配置設置設置爲true。讀完許多文檔後,我無法弄清楚正確的語法。通過appcmd.exe爲加載用戶配置文件設置IIS配置

應用程序池的名稱是像下面,但所有的錯誤了「accountsmanagement.example.com」我曾嘗試變化:

c:\Windows\system32\inetsrv\appcmd.exe set config -section:applicationPools /accountsmanagement.example.com.processModel.loadUserProfile:true 

如何通過正確APPCMD設置負載用戶配置文件設置爲true。可執行程序?

回答

11

試試這個用報價。

c:\windows\system32\inetsrv\appcmd.exe set config -section:applicationPools "/[name='accountsmanagement.example.com'].processModel.loadUserProfile:false" 
+0

這個答案是否將設置設置爲_false_?原始海報想要相反。 – 2016-03-10 01:09:29

0

而不是使用appcmd.exe set config你也可以使用下面的

appcmd.exe set apppool "App Pool name here" -processmodel.loaduserprofile:"true" 

要說明的是,可以設置使用

appcmd.exe set apppool "App Pool name here" /? 
9

如果您想純粹使用PowerShell你可以使用所有值以下PowerShell命令可更改應用程序池的「加載用戶配置文件」屬性。

Import-Module WebAdministration 

Set-ItemProperty "IIS:\AppPools\YourAppPoolName" -Name "processModel.loadUserProfile" -Value "False" 
+0

是的。感謝您分享這一點。自Win2008/IIS 7以來的作品。 – Nathan 2016-02-24 17:18:03