简体   繁体   中英

Setting IIS config via appcmd.exe for Load User Profile

I am attempting to set the config setting for 'Load User Profile' to true via a powershell script using appcmd.exe. After reading through many documents I cannot figure out the correct syntax.

The app pool's name is like 'accountsmanagement.example.com' I have tried variations on the following but all error out:

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

How do I correctly set the Load User Profile to true via appcmd.exe?

尝试使用引号。

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

If you want to Purely use PowerShell you can use the following PowerShell command to change the 'Load User Profile' propertie of an application pool.

Import-Module WebAdministration

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

Instead of using appcmd.exe set config you can also use the following

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

To show all values that can be set use

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM