How to Programmatically tell if an IIS AppPool is 32-bit or 64-bit
I've blogged before about 32-bit vs. 64-bit .NET under IIS and how different Framework-bitnesses need different Application Pools (AppPools).
Someone asked how you find out what AppPools are on a machine and how do you find out which ones are 32-bit? There's a number of ways, depending on your needs:
If you're running a batch file or command-line script and IIS7, you might use the standard IIS7 appcmd.exe tools. You'll need to be Administrator, of course, as we're talking about Web Server configuration here.
To list all AppPools:
c:\Windows\System32\inetsrv\appcmd list apppool
APPPOOL "Joe" (MgdVersion:v2.0,MgdMode:Integrated,state:Started)
APPPOOL "Sally" (MgdVersion:v1.1,MgdMode:Classic,state:Started)
APPPOOL "Fred" (MgdVersion:v2.0,MgdMode:Integrated,state:Started)
To list just 32-bit AppPools:
c:\Windows\System32\inetsrv\appcmd list apppool /enable32BitAppOnWin64:trueBasically, any way, be it WMI, COM, PowerShell, or AppCmd.exe that lets you look at the Enable32BitAppOnWin64 property of an AppPool will get you your answer.
APPPOOL "Fred" (MgdVersion:v2.0,MgdMode:Integrated,state:Started)
About Scott
Scott Hanselman is a former professor, former Chief Architect in finance, now speaker, consultant, father, diabetic, and Microsoft employee. He is a failed stand-up comic, a cornrower, and a book author.
About Newsletter
PS IIS:\ #> dir iis:\apppools | where {$_.enable32BitAppOnWin64 -eq $false}
Name...............................State.................Applications
--------------------------------------------------------
DefaultAppPool_______Started_______Default Web Site
_______________________________________mysite
_______________________________________/appDefault
...
Comments are closed.