Scott Hanselman

How to Programmatically tell if an IIS AppPool is 32-bit or 64-bit

July 01, 2008 Comment on this post [2] Posted in ASP.NET | IIS
Sponsored By

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:true
APPPOOL "Fred" (MgdVersion:v2.0,MgdMode:Integrated,state:Started)
Basically, 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.

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.

facebook twitter subscribe
About   Newsletter
Hosting By
Hosted in an Azure App Service
July 11, 2008 16:14
OpenId test
August 28, 2008 11:45
Here is one of the way how you do it using new PowerShell provider for IIS 7 (sorry for badly formatted output). This command by default will show you all pools with their status and list of assigned applications:

PS IIS:\ #> dir iis:\apppools | where {$_.enable32BitAppOnWin64 -eq $false}

Name...............................State.................Applications
--------------------------------------------------------
DefaultAppPool_______Started_______Default Web Site
_______________________________________mysite
_______________________________________/appDefault
...

Comments are closed.

Disclaimer: The opinions expressed herein are my own personal opinions and do not represent my employer's view in any way.