I want to edit the parts marked in the photo using appcmd.exe or another comman-line method.
Asked
Active
Viewed 1,446 times
-2
-
I thought the configuration is saved as an XML object? – djdomi Jul 25 '21 at 12:51
1 Answers
1
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.

Peter Hahndorf
- 14,058
- 3
- 41
- 58
-
-
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. – Peter Hahndorf Jul 26 '21 at 16:21