Archive for SharePoint 2007

Open with Windows Explorer in SharePoint (Fix Slow WebDAV Performance on Windows 7 / Vista)

SharePoint users and likewise other application users that use WebDav Explorer mode on Windows 7 and Windows Vista PC’s may experience very slow file browsing, opening and modification (e.g. SharePoint Explorer View using WebDAV).

How simple would it be to just uncheck a certain option in IE and fix this brain busting issue, especially for Network Admins and SP Admins?


  1. Open Internet Explorer
  2. Go to the Menu “Tools” > “Internet Options” then go to the “Connections” tab
  3. Click on button “LAN Settings
  4. Uncheck the box “Automatically detect settings” (culprit)
  5. Close and restart all running Internet Explorer processes
  6. Restart the “Web Client” Service, if needed.
  7. Start browsing again…!

Now for a bit of knowledge building

What is the “Automatically Detect Settings” option in IE?

The “Automatically detect settings” option is there to help the user in configuring a web proxy automatically. It actually makes use of the WPAD protocol to discover a web proxy.

1. If the PC is configured to do DHCP, then it will query the server. If the response includes a string with id 252, then it uses this to retrieve a configuration file.

2. If this fails, then the PC will attempt to resolve the name wpad. It will start in its current domain, and work back through. Eg, if the PC is called, it will attempt to resolve, followed by, etc. If this resolves the name wpad, then IE will attempt to retrieve wpad.dat via http from the root of the server. You should probably redirect this to the configuration file.

3. If this yields no success, then IE goes direct.

 Now here is your delay, when Step 1 and Step 2 are running, time-out – finally deciding to open your WebDav folders directly. Phew!

Skip it… if you do not require the auto-discovery feature. Ask your network admin to push a GPO to turn-it-off or uncheck it by default!

SharePoint list or site templates too large for import / export… use STSADM

I love MOSS! But there are some workarounds that you always need to look into if you want your portal to be happy!

Imagine you spent hours on customizing a site that you want to reuse as a template to create new sites. But you hit a dead-end.

Issue 1:
The maximum DEFAULT size permitted by SharePoint for a list or site to be saved as a template is 10MB. Even though I have received the message unexpectedly on sites as small as 5MB or 6MB.

Anyways the fix for this is to increase the maximum permitted property “max-template-document-size” using STSADM. See command below:

stsadm -o setproperty -propertyname max-template-document-size -propertyvalue 50000000

You should now be able to export your site template and save it to a local drive on your MOSS box.

Issue 2:
Now it’s time to use the newly exported site template just incase you need to create a root site collection (you will need to add it to the available Site Collection templates). Simply use the STSADM command below:

stsadm –o addtemplate –filename c:\exercise.stp –title exercise


Securing SharePoint application pages (such as AllItems.aspx, etc.) from members within you organization

When “ViewFormPagesLockdown” won’t work for you and you still want your AllItems.aspx and other forms secured then you have to write some code.

Let me save you some steps, here is the code for a simple control that you can put at the top of a new master page which is a copy of default.master or any other customized master page you created.

This code will by default redirect anonymous users away from the page and will also only allow specified member groups (that you specify) to access the page.

public class SecureItem: WebControl {
private string mGrantGroups = “”;

public string GrantGroups {
get {
return mGrantGroups;
set {
mGrantGroups = value;

private string mRedirPage = “/”;

public string RedirPage {
get {
return mRedirPage;
set {
mRedirPage = value;
protected override void OnLoad(EventArgs e) {
string name = Context.User.Identity.Name;
if (name.Trim() == “”) Page.Response.Redirect(RedirPage, true);

if (GrantGroups.Trim() == “”) return;
string[] grps = GrantGroups.Split(“,”.ToCharArray());
bool doredir = true;
try {
for (int i = 0; i < grps.Length; i++)
if (grps[i].Trim() != “” && SPContext.Current.Web.IsCurrentUserMemberOfGroup(SPContext.Current.Web.Groups[grps[i].Trim()].ID)) doredir = false;

} catch (Exception ee) {
doredir = false;
if (doredir) Page.Response.Redirect(RedirPage, true); // has to be outside of try catch

Your pages are secure now!

Fourth and final release of the MS SharePoint Administration Toolkit

Microsoft announces the fourth (and final) release of the Microsoft SharePoint Administration Toolkit for SharePoint 2007

Why? SharePoint 2010 has some great “features on steriods” in the good old Central Administration. Can’t wait to share, check back soon… preparing a complete deployment, screen-shot installation and upgrade to SharePoint 2010!


Maintain scroll position in your custom ASP.NET pages developed for SharePoint

Hello :)

I can recall more than a few instances where I might have developed custom pages to support corporate SharePoint integrated deployments with or without Dynamic Integration (specifically for long scrolling dashboard pages that are customized). And there have been quite a few cases that my friends have discussed with me on the page scrolling annoyance after a postback has occured!

This is a very common behaviour and a very simple issue to resolve since we talk about ASP.NET pages. Obvious, they all have their Page Directives, ain’t it?

Include the following tag into your page directive:

<%@ Page ... MaintainScrollPositionOnPostback="true" %>

Simple! Try it…

SharePoint Meeting Workspace error in Meeting Minutes – ‘g_instanceID’ is not defined

What a fine morning! A happy client, a happy portal… navigate to the meeting workspace and boom! The left navigation that lists meeting dates are not clickable any more… huh?

This problem started occuring when I switched the portal master page to inherit a custom one that looked really nice :) Following the change, all meeting workspace sites would pop-up an annoying javascript error: ‘g_instanceID’ is not defined

A few verification moves concluded that all meeting workspaces in SharePoint inherit a master page called “mwsdefault.master” that is located in the 12 hive template\global directory. This default meeting workspace master page is static in all meeting workspaces and includes code that is missing in the custom master pages that I built. Error!

To fix this issue:

  • Open you custom master page in SharePoint Designer
  • Copy the missing code from ‘mwsdefault.master’ into your custom master page at the top along with other register tags. The register Microsoft.SharePoint.Meetings tag prefix that has been copied from my mwsdefault.master is same as yours. So you can copy the one below:

<%@ Register Tagprefix="Meetings" Namespace="Microsoft.SharePoint.Meetings" Assembly="Microsoft.SharePoint, Version=, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>

  • After completing the above, copy the Meetings:PropertyBag control into your custom master page. Copy the one below and paste it right after the Body tag.

Save your custom master page, check-in, approve and go live!

Changing SharePoint file upload limit

The default file upload max. limit set by SharePoint during installation is 50MB. Consideribly, this limit should just fit into your agenda unless you want larger files being exchanged on your network. Note that this could affect the performance and availability of network bandwidth to other applications!

I would consider a case when you plan to use SharePoint as your DMS or ECM solution. This could demand for larger files to be uploaded to your portal. In that case, let’s have a look at how we can modify this limit:

  1. Navigate to your portal Central Administration > Shared Services Administration.
  2. You will see a list of Web Application associated with your SSP. Click the required web application that needs the modification to its upload limit.
  3. You will navigate to the Web Application General Settings Page. Scroll to the section “Maximum Upload Size” and modify the limit as per your requirement (see screenshot below).

Note: The value for maximum upload size should not exceed 2047 MB

Displaying attachment link in a SharePoint custom list form – "DispForm.aspx" modified

A recent experience of mine while working with SharePoint lists where we required to customize the out-of-the-box list item display form “DispForm.aspx” to present a design-frenzy item view format.

During the modification process, we never assumed that the list item attachments would abruptly dissapear from the display form. All we were looking to do was to display the list item in a good looking format by modifying the XSLT, but the attachments were gone!

Lesson Learnt: Never modify the out-of-the-box list item display form “DispForm.aspx”. Create a new one if you need to and call it “DispForm_WhateverYouCallIt.aspx”

Now the attachments that were gone seemed quite easy to be brought back on the page. It needed a SharePoint control AttachmentsField that went missing from the picture. Below is the code that you need to add into the XSLT template dvt_1.rowview (into your custom form) that constructs theDataFormWebPart that SharePoint Designer creates for you when you insert a Custom List Form:

Was that easy? The attachments are now showing in the custom form that you just created. Happy Coding!