STSADM Commands Cheat sheets/Poster

May 12, 2009 2 comments


I found a list of STSADM commands for MOSS and WSS on Microsoft site. These are large images and can be printed as poster for your admin nerdiness right next your “Now slower with more bugs” sticker




You can always use stsadm |find “add”  to search or stsadm | more  to list all the commands

more on piping stsadm here

Update : Complete reference of all stsadm commands

Categories: SharePoint, STSADM

Is Null Filter Condition for List Views

April 2, 2009 5 comments

I have always wondered why SharePoint List Views don’t have filters for  Is Null and Is Not Null when CAML Queries support it.

U2U CAML Creator


List View


Turns out it does. When you select “is equal to” and “is not equal to” and do not enter any text it generates “IS Null” and “Is Not Null” CAML Queries for the View.



Result into this



Tools used:

U2U CAML Builder



Categories: CAML, List, SharePoint Tags: , ,

(Jquery)Display Video in SharePoint Blogs from document library

March 24, 2009 4 comments

SharePoint Blogs OOB filters out all the html for embedding any kind of video in them. I use Windows live writer for my Blog post. I use one of the plug-in I think, but even though it wont embed the video within SharePoint it will show take a screenshot of  the video and link to the external site, which is fine for me.

To Display local intranet videos within blog takes bit of work, either hyperlink to media file or Content Editor web part for embedded code.

I using Jquery to accomplish this.

Instead of embedded we shall use Hyperlinks to media files and Jquery.Media plugin for turning them into inline videos.


1.Create 2 Document Libraries

  •  Media: To store all your media files.
  • Resources: To store JavaScript and other files.

2. Download Files.

3.Upload the Jquery JS and mediaplayer.swf to Resource Document library

4.  Edit Jquery Media JavaScript File . In Default Configuration section change location of mediaplayer.swf to the one you just uploaded. Save the file


5. Save and Upload Jquery Media to the Resources document library.

6. On Blog Home Page. Add a content Editor Web Part and Open Source Editor.

Add following script tags to it. (Change the src of javascript location to reflect the files you uploaded in steps above.)

<script type="text/javascript" src="/sharepoint/Sharepoint%20Blog/Resources/jquery-1.2.6.pack.js"></script>

<script type="text/javascript" src="/sharepoint/Sharepoint%20Blog/Resources/"></script>

<script type="text/javascript" >




7.Upload some media files to Media Library

Create a new blog post

in Body Section add a Hyperlink to a video you uploaded to Media library.


File Jquery Media Supports

* Supported Media Players:
*    – Flash
*    – Quicktime
*    – Real Player
*    – Silverlight
*    – Windows Media Player

For more information on Jquery Media click here

Note : If script doesn’t execute replace inline script with this :


function loadMedia() {





If that does not work  I would try this in inline script tags

$(document).ready(function() {



Get Current Page URL using XSL for Content Query Web Part

March 16, 2009 8 comments

I frequently write custom XSL templates for Content Query Web Part (CQWP) for Rolling up List Items. I use  CopyUtil.aspx for link items to to Display Form Pages which on close or after editing the items takes you back to default list item page instead of where CQWP is located.

You can either fix this by

  1. opening a item new window (target =”_blank”  in your href’s )

<a href=”{$DetailPageLink}” title=”{@LinkToolTip}” target=”_blank”>

2. Using Source attribute in your URL. SharePoint ListForm Pages use this to navigate back to location you arrived .

<xsl:variable name=”DetailPageLink” select=”concat($SafeLinkUrl,’&amp;Source=/myPage/CQWP.aspx’)” />
<a href=”{$DetailPageLink}” title=”{@LinkToolTip}”>

3. The Problem with above approach is, If I am reusing this template at different location(page or Site) I would need to recreate this template to just change the source attribute. Also in case you are moving XSL files between environments it could break.

To fix it you can probably use JavaScript to get your current Page URL. I won’t go over this. I will be using often ignored ddwrt xml namespace. (it is 2003 version article but most of the functions work ) and more

Read more…

Fix "Render Failed" Error on Groupby View using Jquery

March 10, 2009 11 comments

I recently encountered this error “&lt;!– #RENDER FAILED –&gt”.


I found the cause for it after searching and browsing various posts and comments about this error.


Well it is a bug and hasnt been fixed anyway the below are the steps/combinations that cause it.

  1. Calculated Field from another list is being used as Lookup Column value in your list.
  2.  Group By the Look Up field (linked to Calculated Field in other List)
  3. Group Setting: Collapsed.

Solution: Apparently from the forums I visited turning Collapsed to Expanded in group setting fixes it and it does. Woo Hoo!.

But the problem is Collapsed setting is used to save real estate and this fix defeats that purpose.


Fixing with Group settings Collapsed

I had read about this Collapsing all Groups feature post at end user SharePoint  by Paul Grenier using Jquery and that seemed like a perfect candidate for this.  In This solution we shall turn Group setting to Expanded and use JavaScript to collapse on load.

  1. Set the Group Setting to Expanded ( this will fix the error)
  2. Use the collapse all code Paul Grenier provides fire it during load.
    1. Add  Content Editor to the Page
    2. Click Edit Web Part and Add the Code below to Source Editor section of the Web Part and in Appearance Section select frame type as “None”.
<script src="" type= "text/javascript">

<script type="text/javascript">
function collapseGroups() {




3. This will Collapse your Expanded Groups.



Issues with this method: I think in regular Group “Expand Collapse” SharePoint remembers your last collapse or group by setting. This script will ignores all that and collapses everything on Page Load

Now there are other ways to accomplish this.

  • Event handler instead of Calculated column to do the calculations and storing value in the field and use that field as look up.
  • JavaScript on Edit and New Form page, by adding  a new field and using Scripts to hide the field and populating them with calculated value (calculation done in the script). Click here to learn more

One Note Web View and SharePoint Integration

March 5, 2009 4 comments

One Note:

"Office OneNote 2007 is a digital notebook that provides people one place to gather their notes and information, powerful search to find what they are looking for quickly, and easy-to-use shared notebooks so that they can manage information overload and work together more effectively." –from Microsoft

More on One Note click links below


Out of the box the One Note does export to different formats but not as a good Web/HTML interface. You need a free plug-in on Microsoft’s codeplex site called One Note Web Exporter to do that.

Download Link:

Steps to export One Note file into HTML format and display on a SharePoint Page using Page Viewer Web Part.
  1. Installation

· Download the plug-in from

· Run the set up.

· Make sure all instances of One Note are closed.

· Open One Note (existing file)

  1. Exporting as Html
    1. Once the plug-in is installed and icon should appear on the toolbar section for the plug-in image
    2. Click on the Icon to export
      1. 1. Select a notebook to export


        2. Set Export Location


        3. Click Preview ( Or Open the Html Page from location you saved using IE)


3. In Step ii above you can even create a daily schedule to export it.

  1. SharePoint Integration:

Out Of the Box you can save One Note files into document library to share it across team members but this requires One Note application to be installed on each user’s computer. To display One Note file within SharePoint as a web page follow the steps below. In Step ii above instead of saving file into local folder, publish it to document library.

    Publish to Document Library

1. Create a Document Library ("One Note")

2. Copy URL and Paste to Screen Export to Web Screen.


(Click "Save As" enter the document library URL e.g. and then enter a filename "Test")

3. Click Export and copy the File URL (e.g. )

4. Go to SharePoint Site use existing Page or create a new "Web Part Page " to display One Note Section.( In this example I am using a Blank Web Part Page )

Display One Note Web View on SharePoint Page

1. Click Site Actions à Edit Pageà Add a Web Part

2. Add Page Viewer Web Part under Miscellaneous Section


3. Click on "open the tool pane" to modify Page Viewer Web Part properties.

1. Click on "open the tool pane" to modify Page Viewer Web Part properties.

Paste the file URL which has been exported to document library in Step C and Paste it in "Link" property text box and under appearance enter a proportionate height for the Web Part check screen shot below for highlighted properties.


This will display the One Notebook within SharePoint Page.