Scott Hanselman

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

July 1, '08 Comments [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
Sponsored By
Hosting By
Dedicated Windows Server Hosting by ORCS Web
Friday, July 11, 2008 12:14:52 PM UTC
OpenId test
Thursday, August 28, 2008 7:45:22 AM UTC
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.