Application pools are a great way to isolate applications from one another even when they share the same server. This ensures a bug in one app won’t directly affect any other apps associated with it. But many a times server admins feel the need to change application pool for an application. Perhaps it has to do with the bug itself. By moving it to another application pool, you protect other apps from the faulty ones. In this article, we’ll guide you through the process of changing the application pool for an app in IIS 7.
Changing an Application Pool for an Application
You can changing the pool in a variety of ways, such as:
The easiest way to get the job done is working with the UI. So let’s adopt the method for changing the application pool. Here are the steps involved:
Your application pool is successfully changed in IIS 7.
Working with CLI
If you want to work on the CLI to make the changes, the follow the steps:
In this syntax, “app.namestring” is the application you wish to change. “applicationPoolstring” is the application pool where the application is intended to be included in. Both are variables.
For example, if you run a website called dogfood and want to add an application called discount to an application pool titled Advertising, the syntax will look exactly like this:
Now the necessary changes have been made.
Writing Scripts in WMI
For website and app administrators, the IIS 7 provides the Windows Management Instrumentation. The WMI scripts contains the methods and classes required to script web administration or web apps administration. Besides this, you can also work on the properties and objects that are associated with admin.
With WMI scripts, you can read, access, and modify files for configurations like the “ApplicationHost.config” or “Web.confg”. The possibilities are endless and this makes WMI scripting really powerful for changing an application pool.
To change this, you need someone who understands scripting. If not, we’d recommend you to use CLI or the UI to change the application pool.
Changing an Application Pool for an Application
You can changing the pool in a variety of ways, such as:
- Working with the UI or User Interface
- Writing scripts for WMI (Windows Management Instrumentation)
- Using the CLI and editing Appcmd.exe file
The easiest way to get the job done is working with the UI. So let’s adopt the method for changing the application pool. Here are the steps involved:
- Open the IIS 7 Manager
- Click on “Application Pool”
- Select the Application Pool Type
- Select “View Application”
- Make the Necessary Changes
- Select Application Pool
Your application pool is successfully changed in IIS 7.
Working with CLI
If you want to work on the CLI to make the changes, the follow the steps:
- Open your terminal
- Start with this syntax in your CLI
Code:
**appcmd setapp /app.name:**string **/applicationPool:**string**
For example, if you run a website called dogfood and want to add an application called discount to an application pool titled Advertising, the syntax will look exactly like this:
Code:
appcmd setapp /app.name:dogfood/discount /applicationPool:Advertising
Writing Scripts in WMI
For website and app administrators, the IIS 7 provides the Windows Management Instrumentation. The WMI scripts contains the methods and classes required to script web administration or web apps administration. Besides this, you can also work on the properties and objects that are associated with admin.
With WMI scripts, you can read, access, and modify files for configurations like the “ApplicationHost.config” or “Web.confg”. The possibilities are endless and this makes WMI scripting really powerful for changing an application pool.
To change this, you need someone who understands scripting. If not, we’d recommend you to use CLI or the UI to change the application pool.