Reputation: 4322
I'm working on a set of scripts to automate the install and configuration of IIS on Windows Server 2008 R2. I'm stumped on how to script the change IIS's default server-level .net framework version from v2.0.50727 to v4.0.30319
I've mostly been using PowerShell so far (good excuse to force myself to learn it) along with the WebAdministration module to perform all of the configuration. A PowerShell solution is preferred, but not required.
Visual reference on where to change this in the IIS Manager:
Upvotes: 1
Views: 2819
Reputation: 5194
You can run the following command from the cmd.exe prompt to change the IIS 7 setting.
C:\Windows\System32\inetsrv\appcmd.exe set config /section:system.applicationHost/applicationPools /applicationPoolDefaults.managedRuntimeVersion:"v4.0" /commit:apphost
Upvotes: 2