Sharepoint Insight by Namwar Rizvi

Sharepoint Tips, Tricks and inside knowledge from real world experience by Namwar Rizvi

Posts Tagged ‘Tips’

Access Denied for SharePoint Site Owner

Posted by namwar on February 24, 2010


There are times when SharePoint can even deny the Site Owner to access his/her site. There are numerous reasons behind this issue but I just want to give you the solution. So here it is:

Step 1:

Run following stsadm command after replacing place holders, mentioned in <>, by actual values:

stsadm -o siteowner -url <YourSiteUrl> -ownerlogin <Domain\AnyValidUser>

 Step 2:

Run following stsadm command after replacing place holders, mentioned in <>, by actual values:

stsadm -o siteowner -url <YourSiteUrl> -ownerlogin <Domain\SiteOwnerLogin>

Thats it. Now access the site by Site Owner user and you will be allowed.

Posted in Solutions, Tips, Troubleshooting | Tagged: , , | Leave a Comment »

How to debug Email Event Receiver

Posted by namwar on January 14, 2010


Normally when you debug an event receiver in SharePoint, you attach your debugger with w3wp.exe process. But email received event is not processed by this process.

Instead, you need to attach your debugger with OWSTIMER.exe process. This is the “Windows SharePoint Services Timer” service.

If this process is not listed in your processes list then click on “Show processes from all users” to display all processes similar to following:

OWSTimer image

Posted in Debugging, Tips | Tagged: , , | Leave a Comment »

How to dynamically construct the SharePoint site relative url in JavaScript

Posted by namwar on January 1, 2010


There are times when you want to dynamically construct a SharePoint site relative Urls e.g. if you are calling a SharePoint webservice from JQuery etc. then you will need to call it in context of your required site.

Most people try to slice and dice the URL of the current page and try to find the SharePoint site from it. This is not a very clean way of doing it.

The more easy and clean way is the way SharePoint itself does which is using the JavaScript variable called L_Menu_BaseUrl

This variable holds the relative url of current site.

So for example, if you want to call Lists.asmx for

http://yourintranet/sites/Finance/ then

L_Menu_BaseUrl + ‘/_vti_bin/Lists.asmx’ will give you the required url for web service.

Posted in JavaScript | Tagged: , , | Leave a Comment »

Displaying only Year in SharePoint Calculated Column

Posted by namwar on November 26, 2009


I wanted to display just the year of a DateTime column of SharePoint. I created a calculated column and set the formula to Year([MyDateTimeColumn]). The result I got was 2,009 ; 2,008 etc. which offcourse incorrect for year. After searching through internet, I found a good article solved my problem.

The correct formula is TEXT(YEAR([MyDateTimeColumn]),”000″)


Posted in Architecture, Customization, Solutions, Tips | Tagged: , , , | Leave a Comment »

Quickest way to copy files from GAC

Posted by namwar on May 30, 2009


Yes, I know how painful it is to realize that you can not copy an assembly out from Global Assembly Cache (GAC), at least not by usual way of copying a file from a windows folder. Don’t worry, there are some ways to do it and the quickest way to browse the GAC and copy files from it is to just map a drive on Windows\Assembly folder.

Here you go, 

  1. From Start-Run type cmd to launch command prompt
  2. Type subst Z: C:\windows\Assembly and press Enter
  3. Thats it!

Now, you got a drive Z which is mapped to your GAC folder and you can easily open it in Windows Explorer and copy files from it.

Isn’t it easy?

Posted in Management, Tips | Tagged: , , , | 1 Comment »