VBScript/IIS – How do I automatically set ASP.NET version for a particular website

Question :

VBScript/IIS – How do I automatically set ASP.NET version for a particular website,

Answer :

I need to script the creation of app pools and websites on IIS 6.0. I have been able to create these using adsutil.vbs and iisweb.vbs, but don’t know how to set the version of ASP.NET for the sites I have just created to 2.0.50727.0.

Ideally I would like to adsutil.vbs to update the metabase. How do I do this?

,

beat me to the punch on the ADSI way

You can do this using the aspnet_regiis.exe tool. There is one of these tools per version of ASP.NET installed on the machine. You could shell out to –

Read More  grep a file, but show several surrounding lines?

This configures ASP.NET 1.1

%windir%microsoft.netframeworkv1.1.4322aspnet_regiis -s W3SVC/[iisnumber]/ROOT  

This configures ASP.NET 2.0

%windir%microsoft.netframeworkv2.0.50727aspnet_regiis -s W3SVC/[iisnumber]/ROOT  

You probably already know this, but if you have multiple 1.1 and 2.0 sites on your machine, just remember to switch the website you’re changing ASP.NET versions on to compatible app pool. ASP.NET 1.1 and 2.0 sites don’t mix in the same app pool.

That’s the answer VBScript/IIS – How do I automatically set ASP.NET version for a particular website, Hope this helps those looking for an answer. Then we suggest to do a search for the next question and find the answer only on our site.

Read More  Numerical formatting using String.Format

Disclaimer :

The answers provided above are only to be used to guide the learning process. The questions above are open-ended questions, meaning that many answers are not fixed as above. I hope this article can be useful, Thank you