Setting IIS config via appcmd.exe for Load User Profile
Asked Answered
L

3

19

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?

Lajuanalake answered 14/3, 2013 at 17:4 Comment(0)
F
21

Try this with quotes.

c:\windows\system32\inetsrv\appcmd.exe set config -section:applicationPools "/[name='accountsmanagement.example.com'].processModel.loadUserProfile:false"
Faucet answered 18/3, 2013 at 20:56 Comment(1)
Doesn't this answer set the setting to false? The Original Poster wanted the opposite.Semidome
M
28

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

Import-Module WebAdministration

Set-ItemProperty "IIS:\AppPools\YourAppPoolName" -Name "processModel.loadUserProfile" -Value "False"
Motile answered 18/2, 2016 at 10:2 Comment(2)
Yes. Thank you for sharing this. Works since Win2008 / IIS 7.Murillo
FYI: WebAdministration module: Process should have elevated status to access IIS configuration data. trying to set config from appcmd.exe also requires elavation though. As they shouldBlessing
F
21

Try this with quotes.

c:\windows\system32\inetsrv\appcmd.exe set config -section:applicationPools "/[name='accountsmanagement.example.com'].processModel.loadUserProfile:false"
Faucet answered 18/3, 2013 at 20:56 Comment(1)
Doesn't this answer set the setting to false? The Original Poster wanted the opposite.Semidome
B
8

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" /?
Barroom answered 16/7, 2015 at 8:22 Comment(1)
Perfect! Thanks!Orms

© 2022 - 2024 — McMap. All rights reserved.