Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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?

like image 915
Steve Avatar asked Mar 14 '13 17:03

Steve


People also ask

What is load user profile in IIS?

Enable IIS option "loadUserProfile:true" for dedicated application pools. In Windows Server IIS, it is recommended to set loadUserProfile:true for dedicated application pools. Doing so guarantees better application isolation and security for web applications created with ASP.NET, . NET Core or PHP.

What is AppCmd exe?

AppCmd.exe is the single command line tool for managing IIS 7 and above. It exposes all key server management functionality through a set of intuitive management objects that can be manipulated from the command line or from scripts.

What is Inetsrv AppCmd exe?

The appcmd.exe is a single command, used to manage IIS 7 and above. It is used to manage the Server without using a graphical administration tool. The appcmd is located in C:\Windows\System32\inetsrv (%systemroot%\system32\inetsrv\) directory. By default, it will not add into environment variable.

How do I run AppCmd?

To start Appcmd.exe At the Command Prompt, type cd %windir%\system32\inetsrv, and then press ENTER.


3 Answers

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"
like image 165
Richard Avatar answered Sep 23 '22 06:09

Richard


Try this with quotes.

c:\windows\system32\inetsrv\appcmd.exe set config -section:applicationPools "/[name='accountsmanagement.example.com'].processModel.loadUserProfile:false"
like image 45
user2184035 Avatar answered Sep 23 '22 06:09

user2184035


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" /?
like image 39
Altered-Ego Avatar answered Sep 22 '22 06:09

Altered-Ego