Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Configure IIS 7 settings on Server 2008 SP2

Status
Not open for further replies.

58sniper

MIS
Apr 25, 2004
9,152
US
Greetings!

Trying to automate some installation requirements for our app. Among the things we need to do are the following for DefaultAppPool:
Set “.NET Framework Version” to v2.0
Set “Enable 32-Bit Applications” to True
Set “Managed Pipeline Mode” to Classic

Has anyone been successful in manipulating IIS config via PowerShell that can point me in the right direction?


Pat Richard MVP
Plan for performance, and capacity takes care of itself. Plan for capacity, and suffer poor performance.
 
I can't use any snapins, because I'm attempting to automate a process performed by the client (so the assumption is always bare essentials installed). But I did come up with this (still needs thorough testing and cleanup)

Code:
# [URL unfurl="true"]http://blogs.msdn.com/powershell/archive/2007/02/25/pause.aspx[/URL]

function Pause ($Message="Press any key to continue...") {
	Write-Host -NoNewLine $Message
	$null = $Host.UI.RawUI.ReadKey("NoEcho,IncludeKeyDown")
	Write-Host ""
}

# [URL unfurl="true"]http://learn.iis.net/page.aspx/114/getting-started-with-appcmdexe/[/URL]
c:
cd \windows\system32\inetsrv
AppCmd list apppool defaultapppool /text:*
AppCmd set apppool DefaultAppPool /managedruntimeversion:v2.0
AppCmd set apppool DefaultAppPool /enable32BitAppOnWin64:"true"
AppCmd set apppool DefaultAppPool /managedPipelineMode:"Classic"
pause
iisreset
pause
AppCmd list apppool defaultapppool /text:*

Pat Richard MVP
Plan for performance, and capacity takes care of itself. Plan for capacity, and suffer poor performance.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top