How to loop through web sites in IIS and change the version of .net and change application pool used?

Posted on 2009-12-20
Last Modified: 2012-05-08
I am getting IIS errors that I have more than one version of .net set.
I have over 3000 websites configured so I need to be able to loop through them all and switch then to a single version of .Net.

I would also like to switch the application pool as well at the same time.

I currently you adsutil for a lot of this stuff, but was hoping for some direction or better yet and example?
Question by:juliandormon
    LVL 17

    Expert Comment


    Author Comment

    Thanks. That's a start. It doesn't answer two of my issues:
    1. How to loop through all of my sites in IIS to apply this
    2. How to change the Application Pool at the same time
    LVL 17

    Expert Comment

    Well you can script it to loop through you sites I do not know what sites you have or what you want to do to them I presume you will have a list of the sites you want to do. Also do you *really* want to do 3000 sites on mass without testing them?? That sounds crazy. Are ALL of the 100% OK to do this huge change?

    You have the method to change the site via a script now and base this on what criteria you desire. I presumed you know how to use adsutil and scripting (as you say you use them) as you manage these large farms.

    Here are a load of scripts to help you further if you need to do multiple functions.

    I don't understand what you mean about changing the application pool?

    There are no .NET configuration settings for app pools. Inside the app pool it will run the .net 1.1 and 2.0 code or php or whatever the applications/sites run but there is no config for it.

    So the app pools you have for all these that currently run a .net 1.1 app it will still run the same if teh app is .net 2.0 or php. There is nothing to change in the app pool.

    Author Comment

    Sorry some background may help here:
    I am getting errors that I have at least 2 different versions of .Net set within the same application pool.
    I gather this means that one or more of the websites we host (which are in fact classic ASP and don't even use .Net) have been set differently. I'd like to make sure they are all set to the same thing.

    As an aside, I have a memory leak somewhere and looks like one ore more of my sites is/are the problem and I would like to isolate these by grouping similar sites into different application pools so I can narrow down that problem.
    LVL 17

    Accepted Solution

    Ok you have got some conflict there. Normally you can get away with it.

    If you do not use .net at all why don't you disable it in the web services extensions?

    That way no .net code can run at all.

    If there is any .net code running you will get (I think) a 404.2 error for each page.

    Author Closing Comment

    Thanks for your help.

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    How your wiki can always stay up-to-date

    Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
    - Increase transparency
    - Onboard new hires faster
    - Access from mobile/offline

    Today I came across an interesting issue that had me pulling my hair out.  I was troubleshooting a new internal web site which uses integrated security instead of anonymous.  When browsing the site from my laptop, I was able to access it with no iss…
    When it comes to showing a 404 error page to your visitors, you do not want that generic page to show, and you especially do not want your hosting provider’s ad error page to show either. In this article, I will show you how to enable the custom 40…
    Hi everyone! This is Experts Exchange customer support.  This quick video will show you how to change your primary email address.  If you have any questions, then please Write a Comment below!
    how to add IIS SMTP to handle application/Scanner relays into office 365.

    737 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    20 Experts available now in Live!

    Get 1:1 Help Now