Clean Out Temporary ASP.Net Files on your MOSS servers

This article is all about the C:\WINDOWS\Microsoft.NET\Framework64\v2.0.50727\Temporary ASP.NET Files folder on your MOSS systems…..

I was alerted by one of my systems this morning that I am running out of diskspace on the systemdrive. After running my favourite tool for this kind of situations, TreeSizeFree.exe, I discovered it was hanging while enumerating a sub-sub-sub…. folder of the Temporary ASP.Net Files folder. Don’t you hate it when a tool you have always relied on hangs like that? Well, I do. Of course copy/paste the path into a cmd window and runing the dir command showed me what was wrong. After endless enumeration of that particular folder I discovered that there were 182000 (that is One hundred and eighty two THOUSAND) files in the folder. No wonder my tool hanged a while. So what’s next? How will I clean this up. Here are the commands I used to cleanup that mess:

1. Stop IIS
     iisreset /STOP

2. cleanup the folder(s).

The problem here is that there are a lot of subfolders in there that need to be cleared as well, so you have two options:

A. using the rd command in combination with a for statement:

for /d %i in (“%systemroot%\Microsoft.Net\Framework64\v2.0.50727\Temporary ASP.NET Files\*”) do RD /q/s %i

B. using robocopy. Just create an empty folder in some place and them run robocopy with /MIR. For example:

md %TEMP%\empty
robocopy %TEMP%\empty “%systemroot%\Microsoft.Net\Framework64\v2.0.50727\Temporary ASP.NET Files” /MIR
rd %TEMP%\empty

(Found this trick on a comment on a blog article of Doug Steward who actually wrote another way to do it)

3. Finally restart IIS

iisreset /START

Some of you might prefer to reboot the system because IIS is down anyway at this time.

So hope this helps you out somehow if you discover a lot of files in there


Speed up SharePoint spin-up and stsadm execution time by Jeroen Ritmeijer

Here is the lifesaver of the month! Jeroen’s post was sent to me by Cedric Carrette (Thanks [:D]).

Original post content;

Ever since SharePoint 2007 was introduced I have been really disappointed with the 2 minute spin-up time of the sites and the 30 second wait when launching STSADM.

How could Microsoft have released this? I thought, What is wrong with these people? Why is there no uproar in the SharePoint Community at large?

As it turns out this problem does not occur on all SharePoint installations, it only happens under a certain combination of circumstances. Fortunately I have identified the root cause as well as a solution.

Symptoms for STSADM:

  • You start STSADM without any parameters
  • There is a delay of about 30 seconds
  • While you are waiting, and tearing your hair out because your deployment script has about 60 STSADM commands, there is no CPU activity, swapping or significant network traffic. 

Symptoms for SharePoint sites:

  • You make the first request of the day, the first request after yet another SharePoint crash or the first request after recycling the app pool because you are developing assemblies that sit in the GAC.
  • There is a delay of about 2 minutes
  • While you are waiting, and tearing your remaining hair out because you know you have to do this at least 50 times today as you are trying to work your way around the various event receiver bugs and limitations, there is no CPU activity, swapping or significant network traffic.

So, what is going on here? Quite a few, but not that many, SharePoint developers are complaining about this on the Internet, but no-one has a real solution. Is there a solution or should I start looking for a new job?

After yet another night of Googling around I found the solution in a posting about SQL Server 2005, which appears under certain circumstances to suffer from the same problem as SharePoint 2007. (Note that in my particular situation the problem is caused by SharePoint being slow, not SQL Server.)

The problem is that when loading signed assemblies the .net Framework checks the Internet based certificate revocation list. As our servers have, like most secure environments,  no outgoing connections to the public Internet the connection to times out after what appears to be 30 seconds. It probably does this a couple of times in succession, causing a 2 minute wait when spinning up SharePoint.

After the timeout the assembly is still loaded and the software works as expected, though very slow every time a new signed assembly is loaded for the first time, which happens a lot. The worst thing is that no entries are written to the event log and no exceptions are thrown so you are left completely in the dark about why your application is so bloody slow.

There are a couple of workarounds, which one works best is for you to decide:

  1. Add to your hosts file and point it to your local machine. Some people have reported success with this, but it didn’t work for me.
  2. Allow your servers to directly connect to If your environment dictates the use of a proxy server, configure it using proxycfg.
  3. Disable the CRL check by modifying the registry for all user accounts that use STSADM and all service accounts used by SharePoint. Find yourself a group policy wizard to help you out or manually modify the registry:

    [HKEY_USERS\<userid>\Software\Microsoft\Windows\CurrentVersion\WinTrust\Trust Providers\Software Publishing]

  4. Download the CRLs and add them to the server manually (I haven’t tested this, but it may work):

    1. Download:
    2. Add them:
      certutil -addstore CA CodeSignPCA.crl
      certutil -addstore CA CodeSignPCA2.crl

We decided to go for Option 3 (disable CRL check) and life is good again….. well as good as it gets when you are doing SharePoint development.

Update – VBScript to apply registry change:

The following script applies the registry change to all users on a server. This will solve the spin-up time for the service accounts, interactive users and new users.

const HKEY_USERS = &H80000003
strComputer = “.”
Set objReg=GetObject(“winmgmts:{impersonationLevel=impersonate}!\\” _
   & strComputer & “\root\default:StdRegProv”)
strKeyPath = “”
objReg.EnumKey HKEY_USERS, strKeyPath, arrSubKeys
strKeyPath = “\Software\Microsoft\Windows\CurrentVersion\WinTrust\Trust Providers\Software Publishing”
For Each subkey In arrSubKeys
    objReg.SetDWORDValue HKEY_USERS, subkey & strKeyPath, “State”, 146944

With thanks to Nik Shaw for the script.

Relevant links:

Changing a web application URL and dealing with requests for the old URL by Brendan Griffin

This post was found on the From the Field Blog and was posted by Brendan Griffin


I recently had a discussion with a customer who was planning on changing the URL of their MOSS 2007 Intranet Web application. This is generally a straightforward procedure that is easily achieved either by amending the alternate access mapping configuration of the web application in question OR extending the web application into a new zone. The customer was comfortable with this and had a plan in place for this change.  In this particular case the customer wanted to change the URL from to

The customer was particularly concerned about the the myriad of links that end users had to content that was held in Internet Explorer favorites’ and embedded in work documents that referenced the old URL – and they wanted to put a mechanism in place that would automatically redirect end users to the new URL when a link that referenced the old URL was selected.

For example a user could click a link that referenced a site collection named Marketing using the URL they wanted this to be automatically redirected to

This objective was easily achieved using a redirect site in IIS 6.0 and involved the following steps.

·         Creating a new website in IIS on each WFE in the farm using the default application pool as it has no need to communicate with any component of MOSS 2007.

·         Configuring the redirect site to listen on the host header (it’s important the MOSS 2007 specific configuration changes are performed prior to this to avoid any conflicts in IIS)

·         Selecting the Home Directory tab of the properties of the redirect site and selecting the following settings, this not only redirects the host name portion of the URL but also the path within the URL 🙂 using the $S and $Q variables. A full reference on these variables can be found at –

Thanks Brendan for sharing!

Application version numbers by Andrew Connell

While I am at it [8-|] 

Found this in this article on the blog of Andrew Connell: .NET Framework 

v 1.0 1.0.3705
v 1.1 1.1.4322
v 2.0 2.0.50727

SQL Server (v7-present)

v 7 RTM 7.00.623
v 7 SP1 7.00.699
v 7 SP2 7.00.842
v 7 SP3 7.00.961
v 7 SP4 7.00.1063
v 2000 RTM 8.00.194
v 2000 SP1 8.00.384
v 2000 SP2 8.00.532
v 2000 SP3/3a 8.00.760
v 2000 SP4 8.00.2039
v 2005 9.00.1399
v 2005 SP1 9.00.2047
v 2005 SP1 + KB918222 9.00.2153
v 2005 SP2 9.00.3042

Content Management Server (MCMS)

v 2001 RTM 4.1.942.0
v 2001 SP1 4.1.942.100
v 2001 SRP1* 4.1.942.308
v 2001 SRP2* 4.1.1106.0
v 2002 RTM 5.0.1581.0
v 2002 SP1 5.0.2284.0
v 2002 SP1a 5.0.4484.0
v 2002 SP2 5.0.5054.0

SharePoint v2 (WSS v2 & SPS 2003)

WSS v2 SP1
WSS v2 SP1 + KB887981
WSS v2 SP2
WSS v2 post SP2 rollup (KB900929) 11.0.8000.0
SPS 2003 RTM 11.0.5704.0
SPS 2003 SP1 11.0.6715.0
SPS 2003 SP2 11.0.8126.0
SPS 2003 post SP2 rollup (KB897722) 11.0.8126.2

SharePoint v3 (WSS v3 & MOSS 2007) **

WSS v3 & MOSS 2007 RTM
WSS v3 & MOSS 2007 SP1
WSS v3 & MOSS 2007 Infrastructure Updates
WSS v3 & MOSS 2007 August 2008 Cumulative Rollup
WSS v3 & MOSS 2007 October 2008 Cumulative Rollup

Be sure to check Spencer Harbar’s killer Post SP1 page with links to all the hotfixes and version numbers… more than I have here.  
* SRP = Security Rollup Package
** – SharePoint v3’s architecture is such that MOSS is treated more or less like a feature pack, thus the underlying versions are the same between WSS v3 & MOSS 2007

Moss version numbers

I’m always looking for this information…..


Cumulative Update KB956056 & KB956057
Infrastructure Update KB951695 & KB951297
SP1 + KB948945
SP1 + KB941274
SP1 + KB941422
October 2007 public update
August 24, 2007 hotfix
Beta 2
Beta 2 TR
Office 12 PDC Pre-beta

 Be sure to check Spencer Harbar’s killer Post SP1 page with links to all the hotfixes and version numbers…

Change the Central admin port with stsadm

Hi all,

just this little tip for today. My colleague configured a test farm a while ago and let the wizard choose the port to be used for the Central Admin webapplication. I don’t know why, but every time I have seen this you get a hideous port from the wizard. So I changed the port to my preferred port number by using the following command:

Stsadm –o setadminport –port 5555

and that’s it. Nothing else to do, no restart, no iisreset, just this command.

I found this info on Shane young’s blog. Thanks for sharing Shane !

Replace SQL 2000 database server hosting your SPS 2003 (and MCMS 2002) databases with SQL 2005

Hello again,

It is been a while since I posted something, but hey, there’s more to life than working [:D]

I am currently working on a SharePoint migration project that requires migrating SharePoint Portal Server 2003 to MOSS 2007. Within this project there is also a need to replace the SQL 2000 backend with SQL 2005. Apparently the In-place upgrade has already been tried before and keeps failing, so I was asked if detaching the databases from SQL 2000, restaging the servers and install with SQL 2005 and attaching the databases would do the trick.

Well it did do the trick! On top of that the SPS 2003 servers were also running Content Management Server 2002 using the same SQL server.

This is what I did (in a lab environment):

1 Sql Server database server with SQL 2000 SP4, used by 2 application servers running both Content Management Server (CMS) 2002 SP2 and SharePoint Portal Server (SPS) 2003 SP2 in a farm scenario.

Once the complete environment was up and running, I stopped both the application servers and detached all CMS and SPS databases from SQL 2000. Next I uninstalled SQL 2000 completely from the database server and installed a clean SQL 2005 database engine with the additional SP2. Once completed I simply attached the CMS and SPS database files to the SQL 2005 configuration to finish off by starting the application servers again. Both CMS and SPS became operational again.

In my scenario everything went really smoothly because all my applications were using the same service accounts. Not being a SQL Guru, I can imagine that an issue can arise with the SQL logins that were defined in SQL2000 and given permissions on the CMS and/or SPS databases. Therefore I believe that these logins and their respective permissions need to be recorded from the original database(s) before uninstalling SQL 2000. Naturally these SQL logins need to be recreated on the SQL 2005 server and assigned their respective permissions on the reattached databases before restarting the application servers.

So replacing the database engine from SQL 2000 with a SQL 2005 database engine does not seem to have any effect on the CMS and SPS server(s) and can be considered an alternative for the in-place upgrade (that in my case seems to fail). Of course it is needless to say that if considering to use this scenario you need to have a good backup and rollback plan available. If you have the ability to install a completely new Database server with SQL 2005 next to the existing SQL 2000 server, you can try to consider to shut down the SQL 2000 server (and physically remove from the network) and installing the new server with the same name as the SQL 2000 server, attach the databases and start the application servers as described above. This way the fallback procedure becomes easier because you can bring the original SQL 2000 server back online if necessary after bringing the new SQL 2005 server down.

Hope this information helps you out.

Download zipped list items – codeplex project by Marijn Somers

My colleague Marijn Somers showed me this tool some while ago already and I thought I’d post this on my blog as well as it is quite usefull


This is what Marijn posted originally on his blog and can also be found here:


 Mohamed Zaki has created a great Codexplex project:Sharepoint Download Zipped List Items

What it does is create an extra button on your “Actions” menu in your libraries, where you can choose to zip documents in this library:
– zip all items
– zip all items with versions
– zip all items in current view
– zip all items in current view with version

Just tested it out and it works great! Versions of documents are just placed with an (X.x) tag in the name.

I do think this one is really useful!
Few comments though:
– it also appears on lists..where you cant zip anything..
– the icon also doesn’t look very good..kinda pixelated..

I believe that if you are using SharePoint to put documents on (as a collaboration environment), you should install this! It adds a lot of functionality to your platform.



Display SQL Data on a SharePoint site

Had this question today from my good friend Cedric. He needed a way to display non-SharePoint SQL data on a SharePoint site. Well, looking around on the net I found these options:

A. You can off course use the built-in Business Data catalog for this, which may be a little bit of overkill if all you want to do is display a simple table.


B. You can buy a SQL Data Viewer Web Part:

Bamboo solutions has one:  (500$ / server licence)


Lightning Tools has one: (400$ / web frontend server)


C. You can or develop you own data viewer web part using this post:


D. You can use the Data View Web part in SharePoint Designer:

This web part is configured with SharePoint Designer. It can use a wide range of data sources including XML files, web services, SQL and Oracle databases and SharePoint list/library content. The rendering is XSLT driven with SharePoint Designer providing a drag-and-drop interface to generate the XSL.



How to display Visio file in SharePoint web part by Elton

Just talked with my colleague Marijn Somers about viewing documents directly on SharePoint sites, when this came up. I remember having done this before for displaying infrastructure Visio drawings on the homesite of the Infrastructure Team SharePoint site using the trick below. I thought to put it on my blog as well (don’t know why I didn’t before, but….) 

So here it is. I found it in an article on Elton’s Ark MSDN blog


I have an idea recently that I want our project web site could display Office Visio file and Office Project .mpp file.

Visio attract me very much for its powerful diagram elements, it could centralize my thinking in a diagram and it is so easy understanding and abstractive in every phase of project life cycle.

For .mpp file I want to replace normal list web part with gantt diagram. Normally we maintain a task list in SharePoint account for the project schedule, but I’d rather to use project file to plan and monitor the project status, because task list is not straitforward for task dependency and task hierarchy, but gantt diagram is a good choice to me.

I found a method to display visio file in SharePoint web part and I don’t know if it is the only solution or not now.

Visio 2003 Viwer active-x control must be installed in client machine even if it has office 2003 installed, before client user browse the sharepoint web page containing visio web part (I don’t like this, but in vain). This active-x control is an add-in of IE to display visio diagram. It could be found at

In SharePoint you could drag & drop a Content Editor web part onto a web part page, then click “Source Editor” button to imput following:

<OBJECT classid=”CLSID:279D6C9A-652E-4833-BEFC-312CA8887857″
id=”viewer1″ width=”100%” height=”100″>
<param name=”BackColor” value=”16777120″>
<param name=”AlertsEnabled” value=”1″>
<param name=”ContextMenuEnabled” value=”1″>
<param name=”GridVisible” value=”0″>
<param name=”HighQualityRender” value=”1″>
<param name=”PageColor” value=”16777215″>
<param name=”PageVisible” value=”1″>
<param name=”PropertyDialogEnabled” value=”1″>
<param name=”ScrollbarsVisible” value=”1″>
<param name=”ToolbarVisible” value=”1″>
<param name=”SRC” value=http://wssxxxx/Shared%20Documents/Yukon%20Timeline.vsd>
<param name=”CurrentPageIndex” value=”0″>
<param name=”Zoom” value=”-1″>

Red color string indicates the visio file’s location in SharePoint. Other parameters could be set according to its effect in IE visio viewer.

The result doesn’t meet my idea completely, anyway it is a solution for displaying the visio file in SharePoint.

Useful link: