Say you have a web server running multiple versions of ASP.NET. Various applications, for better or for worse, depend on a specific version of ASP.NET (e.g. it works under 1.1; throws errors under 2.0).
Here is a function for setting the version using ADSI automation:
Code snippet moved to a dedicated blog for readability