Today I needed to create a .NET v4.0 version of an existing application pool. The old app pool was installed by a vendor install and uses a custom identity that gives it access to the vendor’s application. I don’t know the password to the custom identity, so I couldn’t create a new app pool from scratch.
I wondered about copying and modifying .config files, but this thread has a more elegant solution:
- Stop the application pool you want to copy (otherwise you’ll get “copy : Object reference not set to an instance of an object”–see this StackOverflow article).
- Start PowerShell
import-module webadministration
copy IIS:\AppPools\oldpool IIS:\AppPools\newpool –force
- Restart the source application pool.
Voila! The new app pool is there, referencing the same identity. Change its other properties as needed, then assign your application to the new app pool.
Updated November 19, 2013 to add steps 1 and 5.
Great Tip. Note to anyone trying this, the app pool you are trying to copy must be stopped for this to work.
Hi
I had same scenario and was required a solution.
This is very helpful.
Many thanks Mark.
Gracias.