-2

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

User12
  • 69
  • 1
  • 7

1 Answers1

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
  • 13,763
  • 3
  • 37
  • 58
  • tnx :X, why did you say never run pool as system? – User12 Jul 26 '21 at 07:13
  • 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