Score:-2

How to make a change in iis apppool using appcmd.exe

kr flag

I want to edit the parts marked in the photo using appcmd.exe or another comman-line method. enter image description here

djdomi avatar
za flag
I thought the configuration is saved as an XML object?
Score:1
cn flag

I never use appcmd.exe but you could do this:

 appcmd.exe set config  -section:system.applicationHost/applicationPools /[name='DefaultAppPool'].enable32BitAppOnWin64:"True" /[name='DefaultAppPool'].managedPipelineMode:"Integrated" /[name='DefaultAppPool'].startMode:"AlwaysRunning"  /commit:apphost
 appcmd.exe set config  -section:system.applicationHost/applicationPools /[name='DefaultAppPool'].processModel.identityType:"LocalSystem"  /commit:apphost

In PowerShell using the WebAdministration Module:

 Set-WebConfigurationProperty -pspath 'MACHINE/WEBROOT/APPHOST'  -filter "system.applicationHost/applicationPools/add[@name='DefaultAppPool']" -name "enable32BitAppOnWin64" -value "True"
 Set-WebConfigurationProperty -pspath 'MACHINE/WEBROOT/APPHOST'  -filter "system.applicationHost/applicationPools/add[@name='DefaultAppPool']" -name "managedPipelineMode" -value "Integrated"
 Set-WebConfigurationProperty -pspath 'MACHINE/WEBROOT/APPHOST'  -filter "system.applicationHost/applicationPools/add[@name='DefaultAppPool']" -name "startMode" -value "AlwaysRunning"
 Set-WebConfigurationProperty -pspath 'MACHINE/WEBROOT/APPHOST'  -filter "system.applicationHost/applicationPools/add[@name='DefaultAppPool']/processModel" -name "identityType" -value "LocalSystem"

in both cases you need to replace the name DefaultAppPool with the real name.

I hope you have very good reasons to run your pool as System, I would never do that.

User12 avatar
kr flag
tnx :X, why did you say never run pool as system?
cn flag
Always run your applications / WebSites with the lowest permissions possible. For normal web sites this means, never run as administrator or even system unless you really need to do something that requires it. It your web site get compromised the code injected into it could do anything on your server. Rather use a limited user or the application pool identity and just give it enough NTFS permissions to do its job.
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.