July 2011 - Posts

Crawl Rules Tips in SharePoint 2010

Manage Crawl Rules in SharePoint 

SharePoint admin can include or exclude specific URL during the content crawling stage. The content in SharePoint will be crawled periodically so that that search index will be updated and users can view the latest search result quickly. Administrators can actually "modify" the search result by including or excluding more URLs such that specific content will be included or excluded respectively.

(* It sounds weird for me initially because it violates the concept of findability of public asset on a collaboration platform essentially. However, I do realize the business requirements and accept this truth after understanding the user requirements and business scenario from a real world customer).

To manage crawl rules in SharePoint 2010, you can follow:

SharePoint 2010 Central Administration > Application Mgmt > Service Apps > Manage Service App > Search Service App > Crawling > Crawl Rule

Regular Expression (RegEx) in Crawl Rule

Administrators can input a URL, a pattern or regex when managing crawl rule. I have a requirement to exclude all URLs with a suffix of "AllItems.aspx". However, it is possible that multiple places do have this page, e.g. DocLibA can have a page like "/DocLibA/Forms/AllItems.aspx" and DocLibB also have a page like "/DocLibB/Forms/AllItems.aspx".

In order to exclude a URL with this suffix, I need a pattern that replace DocLib and Forms. However, the DocLib can have multiple levels so the traditional pattern of astersk does not work because we have no clude about how many level do users create in the long run because: /*/AllItems.aspx is different from /*/*/AllItems.aspx

Therefore, the use of RegEx come up immediately and I need to use a wildcard like RegEx pattern with a specific suffix only. Therefore, I go look for some URL reference. However, I got another problem is that the RegEx pattern does NOT work in the same way as I wish because the forward slash "\" got distorted at all.

Original:

Distorted result: http://(/w+//forms//allitems.aspx)$

Finally, I have to use a pattern like this in order to exclude all allitems.aspx under whatever folder and whatever level:

Posted by Colt | 22 comment(s)
Filed under:

Obtain SharePoint 2010 Total Sizes by PowerSehll

I got a request to retrieve the usage and total size of SharePoint sites by a client and luckily I found this PowerShell scripts: http://get-spscripts.com/2010/08/check-size-of-sharepoint-2010-sites.html

In short, it retrieve and recursively loop all sub-sites and sum up the total sizes. I would like to repeat the scripts here for my own reference but please go to the link above for credit and comment.

function GetWebSizes ($StartWeb)
{
    $web = Get-SPWeb $StartWeb
    [long]$total = 0
    $total += GetWebSize -Web $web
    $total += GetSubWebSizes -Web $web
    $totalInMb = ($total/1024)/1024
    $totalInMb = "{0:N2}" -f $totalInMb
    $totalInGb = (($total/1024)/1024)/1024
    $totalInGb = "{0:N2}" -f $totalInGb
    write-host "Total size of all sites below" $StartWeb "is" $total "Bytes,"
    write-host "which is" $totalInMb "MB or" $totalInGb "GB"
    $web.Dispose()
}

function GetWebSize ($Web)
{
    [long]$subtotal = 0
    foreach ($folder in $Web.Folders)
    {
        $subtotal += GetFolderSize -Folder $folder
    }
    write-host "Site" $Web.Title "is" $subtotal "KB"
    return $subtotal
}

function GetSubWebSizes ($Web)
{
    [long]$subtotal = 0
    foreach ($subweb in $Web.GetSubwebsForCurrentUser())
    {
        [long]$webtotal = 0
        foreach ($folder in $subweb.Folders)
        {
            $webtotal += GetFolderSize -Folder $folder
        }
        write-host "Site" $subweb.Title "is" $webtotal "Bytes"
        $subtotal += $webtotal
        $subtotal += GetSubWebSizes -Web $subweb
    }
    return $subtotal
}

function GetFolderSize ($Folder)
{
    [long]$folderSize = 0 
    foreach ($file in $Folder.Files)
    {
        $folderSize += $file.Length;
    }
    foreach ($fd in $Folder.SubFolders)
    {
        $folderSize += GetFolderSize -Folder $fd
    }
    return $folderSize
}

Usage: GetWebSizes -StartWeb <http://URL:Port>

It works great but please bear in mind that the scripts only work for items stored in DocLib and Lists, where order document versions and recycled items do not counted.

Posted by Colt | 1 comment(s)
Filed under:

Crawl PDF Files in SharePoint 2010

  1. Go to Adobe PDF iFilter web page
  2. Download PDF iFilter for 64-bit Platform
  3. Extract and Install iFilter
  4. Run RegEdit and modify Filter (HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Office Server\14.0\Search\Setup\Filters)
  5. Run RegEdit and modify Extension (HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Office Server\14.0\Search\Setup\ContentIndexCommon\Filters\Extension)
  6. Run "iisreset" in cmd to restart Server(s)
Posted by Colt | 2 comment(s)
Filed under:

Associate PDF icon to PDF documents in SharePoint 2010

  1. Go to http://www.adobe.com/misc/linking.html 
  2. Download PDF small icon (17 x 17)
  3. Save it to C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\TEMPLATE\IMAGES
  4. Edit DocIcon.xml under C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\TEMPLATE\XML folder
  5. Add <Mapping Key=”pdf” Value=”pdficon_small.gif” /> under <ByExtension> section

Posted by Colt | with no comments
Filed under:

Remove Background in Replying or Forwarding an Email

Microsoft Outlook allow users to compose an email with an attractive background / coloring / signature, but it's disturbing for me because it change my default/personalized style when I reply / forward an email.

I just want to compose a clean and tidy email so I look for the steps to remove a background in email, and I found two ways to do that:

  1. Change to Plan Text mode completely (Lost all Rich Text Formatting): Format Text >  Plain Text


  2. Just remove background color: Options > Page Color > No Color

Posted by Colt | 25 comment(s)
Filed under:

New Cloud Storage Explorer (Free Edition) is released

In addressing the recent change of SkyDrive, Cloud Storage Explorer have just updated its free edition tool yesterday.
Posted by Colt | with no comments
Filed under:

Fix The Annoying "Windows Explorer has stopped working" Message in Windows 7

A friend of mine told me the captioned message when he try to right click an object in Windows 7 desktop. It's really strange because my friend and I are using the same installation disc while my Windows is working properly (touch wood) now. Anyway, below are the suggestions or directions that anyone who seen this message:

  1. Restart your Windows - Well, it normally works :)
  2. Disable User Account Control - Procedure here
  3. Run Windows Update - Check any missing or outdated drivers of your OS and peripherals
  4. Disable / Uninstall Anti-Virus - Sometimes it works
Posted by Colt | 26 comment(s)
Filed under:
More Posts