Monthly Archive November 2011

AvatarByRashid Aziz

SharePoint 2010 chart using external data (BCS)

I want to share sharepoint 2010 OOTB feature which impressed me a lot. You can create chart in SharePoint 2010 based on external data without any custom code or using enterprise features like excel services.

So what you waiting for, follow these simple steps to get visual representation of your data in minutes.

Open the sharepoint 2010 site and go to the page where you want to add web part.

Open this page in the edit mode so you can add web part.

Now pick “Business Data” category and select “Chart Web Part” web part and add it to page. Save the page.

Go to web part properties window and chose “Connect to Data”.

From the connection source list pick “Connect to Business Data”. (If you already created a list form external content type then you can pick list form the available sharepoint lists.)

Now pick the external content type you have created earlier.

Next you will bind user interface chart to data.  You can also define more filter options

Click finish, and your web part will display the chart based on data you have selected.

AvatarByRashid Aziz

How to block sandbox solution on SharePoint 2010 farm

In sharepoint 2010 we can upload and activate sandbox solutions. Although the sandbox solutions can slow down the page system pages execution of cause an error on page. The administrator has the ability to block the sandbox solution for a particular SharePoint 2010 farm. Once the solution is blocked it can’t be activated by any user and prompt will an error message.

For testing I create a sandbox solution and called it “sandbox 1.wsp”.

Now go to the PowerShell command line and type the following commands.

$UserCodeSvc = [Microsoft.SharePoint.Administration.SPUserCodeService]::Local
$Signature = [Microsoft.SharePoint.Administration.SPUserCodeService]::
$BlockedSolution = New-Object Microsoft.SharePoint.UserCode.SPBlockedSolution
-ArgumentList ($SolutionName), ($Signature), ("Solution Blocked")

Now go to the central admin> System settings> manage user solutions, you will see that “sandbox1.wsp” is in the blocked solution list.

AvatarByRashid Aziz

Recycle bin retention period setting using PowerShell

In SharePoint 2010 there is a recycle bin property called “RecycleBinRetentionPeriod”. This property specifies the number of days files will be stored in recycle bin and then will be deleted after that period.

I wrote a PowerShell script to set the SharePoint 2010 site retention period without much hassle.

$siteUrl = ""
Write-Host "Connecting to the site"
$SPSite = Get-SPSite | Where-Object {$_.Url -eq $siteUrl}
if($SPSite -ne $null)
$SPSite.WebApplication.RecycleBinEnabled = $true
$SPSite.WebApplication.RecycleBinRetentionPeriod = 20

Hope this will help.

AvatarByRashid Aziz

Sharepoint 2010 web application maximum upload file size limit

The maximum file size setting will determine the maximum size of files uploaded to document libraries on the site. You can set the sharepoint 2010 web application max file size limit in many ways, but   I have done this in PowerShell.

I wrote a smart PowerShell script to do this job.

$siteUrl =
Write-Host "Connecting to the site"
$SPSite = Get-SPSite | Where-Object {$_.Url -eq $siteUrl}
if($SPSite -ne $null)
$SPSite.WebApplication.MaximumFileSize = 200


Hope this will help you.

AvatarByRashid Aziz

Collaboration site default page setting in SharePoint 2010

In the last post I have explained how you can change publishing site default page using PowerShell

You can also achieve same for collaboration site. In this post I explain how SharePoint 2010 collaboration site default page is set up. 

$site = get-spsite "http://site URL”

$file = $site.RootWeb.GetFile("Pages/Default_Copy.aspx")
$folder = $site.RootWeb.RootFolder
$folder.WelcomePage = $file
AvatarByRashid Aziz

Setting up publishing site default page in sharepoint 2010

In SharePoint 2010 publishing site you can choose the default page for that site. In the following example I will show you how you can change the default page of publishing site by using PowerShell.

$site = get-spsite "http:// site URL”

$pub = [Microsoft.SharePoint.Publishing.PublishingWeb] :: GetPublishingWeb($site.RootWeb)
$file = $pub.Web.GetFile("Pages/New_DefaultPage.aspx")
$pub.DefaultPage = $file
AvatarByRashid Aziz

Use PowerShell to set security timeout in SharePoint

A user logged off after a certain period of time from sharepoint 2010 site. You can reset this timeout according to your requirement.  If you need a user session to be open for more time you can always change the security time out by using PowerShell.

Open PowerShell management console and copy past the following code.

Note: change the session Time span according to your need. In this code it is setup as 1 hour and 20 minutes.

$SPSite = Get-SPSite("[URL of site collection]")
$webApp = $SPSite.WebApplication
$webApp.FormDigestSettings.Enabled = $true
$webApp.FormDigestSettings.Expires = $true
$webApp.FormDigestSettings.Timeout = New-TimeSpan -Hours 1 -Minutes 20

Now it will enable the session expiry time to 1 hour and 20 minutes for this site collection.

AvatarByRashid Aziz

SharePoint 2010 should or should not be on cloud

There are some benefit and consideration if you move your sharepoint 2010 environment on cloud for your organizations. Let’s talk about the good bits first and then we will move towards the worries. J

Benefits: (why sharepoint should be on cloud)

Simplify SharePoint ownership

Managing SharePoint technically on premises is a big challenge, things like in house SharePoint upgrade, backup and recovery adds more cost into it. If you use cloud then you are actually transferring the sharepoint farm maintenance and availability to the cloud service providers.

Cloud is cheaper solution for some Organizations

The cost of hardware and training for in house SharePoint could be very high, especially for smaller organizations. The cloud approach makes SharePoint more affordable and easy to implement. I can say this will be a greater interest for smaller organizations.

Best for OOBT solutions

The cloud based SharePoint 2010 solution in small to medium sized businesses who mostly require out of the box (OOTB) features and functionality and departmental permission strategies.

Considerations (Reasons why SharePoint on cloud is not best in your case)

Site Customization problems

There are some doubts about using custom code solution on sharepoint server in the cloud. The big concern is the performance.

Business Connectivity Services lacking on cloud

At the moment sharepoint 2010 on cloud does not have support for “Business integration service called “Business Connectivity Services (BCS)”. This is a big cause for organizations to hold back cloud migration that is using BCS or intend to use BCS service in future.

Third Party Products & Solutions

If your organization is heavily relaying on third party solutions or products, you need to engage them to make sure that the solutions or product are fully tested on cloud before making a decision.

Note: This is really open to discuss, please add any comments and concerns and we all can understand it better.

AvatarByRashid Aziz

Print SharePoint wiki pages all at once

Have you come across a scenario when you have multiple wiki pages on your sharepoint site and you want to print them all? I think it will be a big time waste if you have thousands of pages and start printing them one by one.  Here is a workaround to print multiple wiki pages in one go.

  1. Create a numeric type column “Page Number” on your wiki library.
  2. Now fill “page Number” for each wiki page and assign it a numeric page number.
  3. Now create a new view for wiki list and name it “Printable view”. Select only the “wiki content” filed for this view and sorts the “wiki content” field based on “Page Number” column. You can also filter it on Page Number” column value >0 if you are not printing all wiki pages. Unnumbered wiki pages will be excluded from view in this case.
  4. When new view will be created you will see your wiki pages in a single web page. Now you can send it to printer from here or can copy past on word document for further editing and then print it.

Once you do the setup this solution is really time saving.

AvatarByRashid Aziz

SharePoint blog with attachment capability workaround

By default there are not any settings in sharepoint to enable attachments with blog posts. It is not a perfect way to do this, but worth to mention on my blog I think.

I have done a workaround to achieve this

  1. Create a custom list inherited form Item with default columns.
  2. Create new item “give it a title” and attach your document with it.
  3. Now in your post list create a lookup column with the title “Attachment” which will look up to the “Title” column of your custom list.
  4. Edit the view of you posts web part on the blog main page and enable it to display the lookup field. You can now see the attachment in the footer.

I hope this blogs helps J