Musings on Cloud, BigData, AI, Machine Learning, Containers and IOT

Steps to Configure SharePoint 2010 Information Worker Demonstration and Evaluation Virtual Machine

This article would cover the necessary steps to configure the SP 2010 Information Worker Demo VPC. The easiest way to have a development environment for personal learning need is to download the SharePoint 2010 Information Worker Demonstration VPC and configure it for your needs, rather then setting up a dev server-farm from scratch.


Though most of the steps to configure this VPC is available in Microsoft’s guidance, I’d try to cover the things which are not there in MSDN guidance and would make it more comprehensive.

1. Download the VM files from Microsoft site and run the application file 2010-7a.part01.rar

2. This would extract all the 20 files into a large VM dump (2010-7a.vhd)

3. On the extracted folder, you’ll find a configuration file


<?xml version="1.0" encoding="UTF-16" standalone="yes"?>
  <SnapShotDataRoot type="string"></SnapShotDataRoot>
  <ExternalDataRoot type="string"></ExternalDataRoot>
    <source type="string">E:VMsa-andcar2010-7aVirtual Hard Disks2010-7a.vhd</source>
    <target type="string"></target>
  <VmStateCopied type="bool">true</VmStateCopied>

4. By default the “<Source type-“string”> will have the path of E:VMsa-andcar2010-7aVirtual Hard Disks2010-7a.vhd. You need to change it to the path of your local PC, where the .vhd file is saved. Otherwise, you’ll get an error when you to run this VM in the hyper-v. In my case, I’ve changed the path to D:SP 2010 VM7a2010-7aVirtual Hard Disks2010-7a.vhd.

5. The next step is to define the Network connections in the Hyper-V.

Start Hyper-V Manager from Control Panel -> Administrative Tools

Click Virtual Network Manager

Choose New virtual network in the Virtual Networks pane

Choose Internal from the type list and click Add

 Enter a name of Internal and click OK


6. Start menu -> right-click Network –> Properties

    Click Change adapter settings

    Locate the adapter corresponding to ‘Internal’,


    Right click and choose properties

    Double click on IPV4 and set the following IP addresses.


7. The next steps is to define the Internet Connection (External) for the VPC.

On the Virtual Network Manager define an ‘External’ network connection.


Now you’ll see a new network connection called ‘External’ in the Network connections


I’ve set up wireless network connection already on my windows server 2008 hosting SP 2010 VPC. The name of the connection

is Wireless Network Connection.


Right click on wireless network connection –> properties –> Sharing

Check ‘ Allow other network users to connect through this computer’s internet connection’.

Under home networking connection chose the network connection name corresponding to External Adapter defined in hyper-v. In my case it is VLAN2.


This will allow the VM to access the internet.

8. Import the Virtual Machine into hyper-v. Otherwise, you can create a brand-new Virtual Machine with the required custom settings using the extracted .vhd file.

9.Start the virtual image

10. Once the machine starts log in as administrator and password is pass@word1

11. The next step is to do re-arming. The re-arming needs to be done after 10 days from the initial usage.

 Run “slmgr –rearm” (no quotes) in the command prompt to complete re-arming.

12. Last, but not least, add the following host entries





This completes the configuration for SP 2010 Information Worker demonstration VPC.


 Subscribe to my blog

Create SharePoint 2010 Visual Web Parts as Sandboxed Solution with Visual Studio 2010 Power Tools

This article will focus on how to create SharePoint 2010 Visual Web Parts as Sandboxed Solution. In the initial release of SP 2010, the Sandboxed Solution Architecture had restriction in terms of supporting Visual Web Parts in the Sandboxed environment. This has been fixed by the recent release of Visual Studio Power Tools for SharePoint 2010, which helps to create Visual Web Parts for Sandboxed environment.

Here are the steps below :-

File –> New –> Project –> Empty SharePoint Project



Then choose ‘ Deploy as Sandboxed Solution’.


Click ‘Finish’.

Add –> New Item –> Visual Web Part (Sandboxed)


Implement some arbitrary functionality inside the web part.


Right click on Solution Explorer –> Deploy

Now you can see the Sandboxed Solution available in the Solutions Gallery.



Event though the Visual Studio Power Tools supports Sandboxed Solution, there are some caveats/limitations around that.  The following are not supported.

1. SharePoint Web Controls and some advanced ASP.NET controls

2. Use of “<@ Assembly Src=” directive is not supported

3. Java Script debugging is not supported in Visual Studio.

 Subscribe to my blog

Restrictions in SharePoint 2010 Sandboxed Solutions – Part 2

The code inside SharePoint 2010 Sandboxed Solutions is limited by code access security policy restrictions. The code access security policy for the sandboxed solution worker process is defined in the %ProgramFiles%Common FilesMicrosoft Sharedweb server extensions14CONFIGwss_usercode.config file and it is referenced in %ProgramFiles%Common FilesMicrosoft Sharedweb server extensions14UserCode.

The following permission levels are denied by code access security policy.


Denied Permissions












Cannot read/write to file system











Cannot access unmanged code, Threads, App Domains etc.



Cannot access .NET Reflection APIS and non-public class & members in managed code










The following permission levels are granted by code access security policy.


Granted Permissions






Can execute resources, but not read/write access to resources




This completes the final part (Part 2) of the article ‘Restrictions in SharePoint 2010 Sandboxed Solutions’.

 Subscribe to my blog

Full Trust Proxies in SharePoint 2010 Sandboxed Solution – Faqs

  1. What is full trust proxy in the context of SharePoint 2010 Sandboxed Solution?

    A full trust proxy is a mechanism that allows Sandboxed Solution to make a call to trusted assembly outside the Sandbox environment. The trusted assembly can be designed to make external calls (to database or web services), which Sandbox solutions cannot reach. This needed, because not all the SharePoint 2010 solutions might want to live as Sandboxed (with restrictions). In most of the cases, the assemblies inside SharePoint solutions might want to make external calls (to a database or to a web service).


  2. How to create a full trust proxy operation in Sandboxed Solution?

    Here are the steps required to create full trust proxy operation using Visual Studio:-    

    1. Create a farm solution , create a c# class that is derived from SPProxyOperation and override Execute method
    2. Create another c# class (in the same solution), that is derived from SPProxyOperationArgs. Pass an instance of this class to the Execute method of SPProxyOperation class.
    3. Create a Feature Receiver to register operation with SharePoint Foundation User Code Service
    4. In the Sandboxed Solution project, create a class that calls the proxy operation
    5. Deploy the Sandboxed solution


  3. In which process does the full trust proxy runs?

    The full trust proxy does not run in w3wp.exe, rather it runs in SPUCWorkerProcessProxy.exe.


  4. How to programmatically activate the full trust proxy with user code service?

    The following is the code snippet for activating full trust proxy.


         SPProxyOperationType proxyOperationType = new SPProxyOperationType(type.Assembly.FullName, type.FullName);

    SPUserCodeService userCodeService = SPUserCodeService.Local;




  5. How to programmatically de-activate the full trust proxy with user code service?

    The following is the code snippet for de-activating full trust proxy.


     SPProxyOperationType proxyOperationType = new SPProxyOperationType(type.Assembly.FullName, type.FullName);

     SPUserCodeService userCodeService = SPUserCodeService.Local;



 Subscribe to my blog

Restrictions in SharePoint 2010 Sandboxed Solution – Part1

We all know that SharePoint 2010 Sandbox Solution is restricted and it has access to only the subset of functionalities available in Microsoft.SharePoint namespace. In this article, we’ll see restrictions imposed by Sandboxed solutions. Basically, the calls made by Sandboxed solution are routed through subset proxy, which in turn makes the calls to the full object model. In this case, the subset proxy brings in the restriction by exposing limited set of functionalities. Here is the list of API exposed by subset proxy.






All of the Microsoft.SharePoint namespace except the following


a)SP Site Constructor

b)SP Security Object

c)SPWorkItem and SPWorkItemCollection objects

d)SPAlertCollection.Add method

e)SPTransformUtilities Object

f)SPUserSolution and SPUserSolutionCollection objects




All of the Microsoft.SharePoint.Utility namespace except the following :-


a)SPUtility.SendEmail method




All of Microsoft.SharePoint.WebPartsPage

Except the following


a)SPWebPartManager object

b)SPWebPartConnection object

c)WebPartZone Object

d)WebPartPage Object

e)ToolPart object

f)ToolPane Object


If we examine the restrictions carefully, we can infer that the capabilities of the core foundational object model is available in the Sandboxed Solutions. However the advanced capabilities like Search, BCS, Access Services and Excel Services are restricted.

Next, we’ll see what are all the SharePoint 2010 Project types supported by Sandboxed Solutions.


SharePoint projects supported by sandboxed solution

SharePoint projects not supported by sandboxed solution


Content Types / fields


Modules / files

Application pages


List definitions

Web application scoped features


List instances

Custom action group


Site definitions

HideCustomAction element


Web Template Features

Content type binding


Web parts (non-visual)



Feature Callouts



Declarative workflows



Custom actions












Here are few more restrictions. The code inside Sandboxed solution cannot perform the following operations:-

a) Cannot read/write to the file system

b) Cannot call the network

c) Cannot write to the Registry

d) Cannot call assemblies deployed out of Global Assembly Cache

The next part of the article would cover the CAS policy restrictions on Sandboxed solution


At this point of time, the Visual Web Parts can be created as Sandboxed Solutions with the help of Visual Studio Power Tools for SharePoint.


 Subscribe to my blog

India Wins World Cup Cricket after 28 Years

Today is a very special day in the history of Indian Cricket. Yes, the Indian Cricket Team have Won the cricket world cup after 28 years. We have done it again. This makes us (all of the Indians) really proud. Another crown for the little master in his cricketing Journey. Kudos to Dhoni & Co, special mention to Yuvraj Singh and no words to describe the genius of little master Tendulkar.

Team India have made this country proud again.

What a moment for die-hard cricket fans ?

Pic01 Pic02 Pic03
Pic04 Pic06 Pic07
Pic08 Pic09 Pic11

Replace SharePoint 2010 Search Box using Delegate Control

The Delegate Controls comes into picture when want to brand a SharePoint Site. The delegate control acts like a container control which encapsulates default content (set of child controls inside it). The default content (set of child controls associated with delegate) can be substituted by a specific control, by creating a feature. The ability to override or substitute the delegate controls brings the power & flexibility to brand SharePoint Sites.

The out-of-box SharePoint Foundation Master Page defines many controls like Top Navigation Data Source, Left Navigation Data Source, Search Box and Additional Page Head etc as delegate controls. The list is illustrated below :-

<SharePoint:DelegateControl runat="server" ControlId="AdditionalPageHead" 
<SharePoint:DelegateControl runat="server" ControlId="GlobalNavigation" />
<SharePoint:DelegateControl runat="server" ID="GlobalDelegate0" ControlId="GlobalSiteLink0" />

<SharePoint:DelegateControl ControlId="GlobalSiteLink2" ID="GlobalDelegate2" Scope="Farm"
 runat="server" />

<SharePoint:DelegateControl runat="server" ControlId="PublishingConsole" 
</SharePoint:DelegateControl><SharePoint:DelegateControl ControlId="GlobalSiteLink3" Scope="Farm" 
runat="server" />
<SharePoint:DelegateControl runat="server" ControlId="SmallSearchInputBox" Version="4" />

<SharePoint:DelegateControl runat="server" ControlId="TopNavigationDataSource" 

The above listed delegate controls can be substituted at runtime to achieve custom branding. Let’s try to replace the Small Search Input box and see how the delegate control helps for this process. The whole idea is to define a feature for the Custom User Control with same control id mentioned in delegate and the lowest possible sequence number.

Here are the steps below :-

File —> New Project —> Empty SharePoint Project


Right Click Project –> Add New item –> User Control . Name it as ‘ReplaceSearchBox’


It automatically creates control templates folder and places the user control underneath that. Create any arbitrary control inside the user control. For the illustration purpose, I’ll add a Calendar Control inside the user control, to visually show a difference how the page looks after the delegate substitution.

<asp:Calendar ID="Calendar1" runat="server"></asp:Calendar>
It automatically creates control templates folder and places the user control underneath that.

Right Click Features –> Add Feature

Set the Feature Scope at Site (site-collection level)

Right Click Solution —> Add New Item –> Empty Element

We’d be leveraging Elements.xml file for the delegate substitution process. Before jumping on to the substitution lets understand how the out-of-box Search Box is defined using Feature.


The Search Box is defined in both the Features ‘OSearchBasicFeature’ and ‘OSearchEnhancedFeature’ in the location 
C:Program FilesCommon FilesMicrosoft SharedWeb Server Extensions14TEMPLATEFEATURES
The definition looks like the following :-
<Elements xmlns="">
ControlAssembly="Microsoft.Office.Server.Search, Version=, Culture=neutral, 

    <Property Name="GoImageUrl">/_layouts/images/gosearch15.png</Property>
    <Property Name="GoImageUrlRTL">/_layouts/images/gosearchrtl15.png</Property>
    <Property Name="GoImageActiveUrl">/_layouts/images/gosearchhover15.png</Property>
    <Property Name="GoImageActiveUrlRTL">/_layouts/images/gosearchrtlhover15.png</Property>
    <Property Name="DropDownMode">ShowDD</Property>
        <Property Name="SearchResultPageURL">/_layouts/osssearchresults.aspx</Property>
    <Property Name="ScopeDisplayGroupName"></Property>
    <Property Name="FrameType">None</Property>
<Elements xmlns="">
Here the Id & Sequence number of the control plays an important role. 
To substitute this out-of-box SmallSearchInput box, Let’s define Elements.xml file for Feature. The id of the control should match with id of control to be replaced. 
The Sequence number should be less than the sequence number of the out-of-box control. In this case we’re assigning sequence number as 10, so that the control with the lowest
 sequence number gets precedence.
    <Control Id="SmallSearchInputBox" Sequence="10"
      ControlSrc ="~/_controltemplates/ReplaceSearchBox/ReplaceSearchBox.ascx">        
Since we’re using an user control for substitution, we need to make sure that ControlSrc attribute is defined. There is no need to define ControlClass and ControlAssembly attribute here. 
I did define all the 3 attributes, but the substitution was not happening. I’ve learnt that it’s enough to define the ControlSrc attribute itself. Do not define all 3  attributes for user control, 
the substitution will not happen. If you are using Custom Control, it makes sense to use ControlClass and ControlAssembly attribute.
The final Solution Package looks like the following :-

Build the Project, Package it and Deploy.

Now you can see the the custom user control with Calendar replaces the Delegate control.

Delegate Substitution


 Subscribe to my blog

Recycle IIS Application Pool: Cannot connect to the SharePoint site

I created a Visual Studio 2010 SharePoint Project. When i tried to build and deploy the solution from Visual Studio, i got the following error :-

Error occurred in deployment step ‘Recycle IIS Application Pool’: Cannot connect to the SharePoint site: http://samplesite/. Make sure that this is a valid URL and the SharePoint site is running on the local computer. If you moved this project to a new computer or if the URL of the SharePoint site has changed since you created the project, update the Site URL property of the project.

I realized the i’m not the administrator of the box and also did not have the access to the SharePoint content db. I fixed this issue by doing the following :-

1. Added myself as the administrator

2.Added myself to SharePoint Farm Admin Group

3. Provided DB Owner access to SharePoint Content DB


 Subscribe to my blog

SharePoint Webcasts for January 2011

I tried to collate the list of SharePoint web casts that are scheduled for January 2011. They are listed below :-

1. How to use Team Foundation Server to Manage the SharePoint Life Cycle

1/6/2011 12:00 PM Mountain Time (US & Canada)

2. How to use Team Foundation Server to Manage the SharePoint Life Cycle

1/20/2011 12:00 PM Mountain Time (US & Canada)

3. MSDN Webcast: SharePoint Ecosystem: SharePoint Online – Developing Solutions for the Cloud (Level 200)

1/11/2011 9:00 AM Pacific Time (US & Canada)

4. TechNet Webcast: Search-Driven Internet Sites: Increase Relevancy, Lower Overall Costs (Level 200)

1/11/2011 1:00 PM Pacific Time (US & Canada)

5. Business Insights Webcast: Search and Community Experiences with SharePoint Server for Internet Sites (Level 100)

1/19/2011 11:00 AM Pacific Time (US & Canada)

6. MSDN Simulcast Event: SharePoint FireStarter

1/27/2011 8:30 AM Pacific Time (US & Canada)

7. TechNet Webcast: Using Office and SharePoint to Take Control of Marketing Spend and ROI (Level 100)

1/25/2011 1:00 PM Pacific Time (US & Canada)

 Subscribe to my blog

Develop Custom Workflow Activity for SharePoint 2010 Workflow

In this article, I’d be discussing the steps to create a custom workflow activity for SharePoint 2010. The need for custom workflow activity arises, when the out-of-box workflow activities do not suffice our requirement. The functionality of developing a custom activity for SharePoint 2010 Workflow is not a new feature in SharePoint 2010. This was available in SharePoint 2007, which is now continued to SharePoint 2010. Once the custom workflow activity is created, it can be made available for use inside SharePoint Designer 2010.

File —> New Project

Select —–> Visual C# —> SharePoint | 2010 —-> Empty Project

custom activity 1

custom activity2



Click Finish

File —> Add –> New Project

Select the Visual C# | Workflow | Workflow Activity Library and set the project name as ‘CreateActivityDemo’.

custom activity3[5]

Right click ‘CreateActivityDemo’ project and add a reference to Microsoft.SharePoint.dll and Microsoft.SharePoint.Workflow.Actions.dll

Add a new workflow activity called ‘CreateSurveyLibrary.cs’

Switch to view code of ‘CreateSurveyLibrary.cs’

Import the following namespaces

using Microsoft.SharePoint;
using Microsoft.SharePoint.Workflow;
using Microsoft.SharePoint.Workflow Actions;
Add a dependency property property by name ‘SiteUrlProperty’
 public static DependencyProperty SiteUrlProperty = DependencyProperty.Register("SiteUrl", 

typeof(string), typeof(CreateSurveyList), new PropertyMetadata(""));
        [DescriptionAttribute("Url of site where survey is to be created")]
        public string SiteUrl
                return ((string)(base.GetValue(CreateSurveyList.SiteUrlProperty)));
                base.SetValue(CreateSurveyList.SiteUrlProperty, value);

The SiteUrlProperty is used to capture the url of the site, in which the survey list needs to be created. The convention for creating the dependency property is to have the keyword ‘Property’ appended (at the end) to the name of the actual property. In this case, the name of the regular C# property is SiteUrl, the dependency property is created with convention of ‘SiteUrlProperty’. If this naming convention is not followed, we’ll get a compilation error.

Add another dependency property called ‘SurveyListNameProperty’. This is used to assign the name for Survey List during the list creation.

 public static DependencyProperty SurveyListNameProperty = DependencyProperty.Register("SurveyListName", 

typeof(string), typeof(CreateSurveyList), new PropertyMetadata(""));
        [DescriptionAttribute("Name for survey list")]
        public string SurveyListName
                return ((string)(base.GetValue(CreateSurveyList.SurveyListNameProperty)));
                base.SetValue(CreateSurveyList.SurveyListNameProperty, value);
Again, follow the same naming convention for creating this dependency property ‘SurveyListName’, discussed above.

The next logical step in creating custom workflow activity for SharePoint is to override the Execute method of the workflow activity. Then add the relevant logic to the Execute method for creating a Survey List in the specified site with the specified survey list name.

protected override ActivityExecutionStatus Execute(ActivityExecutionContext executionContext)
            return ActivityExecutionStatus.Closed;
        private void CreateSurveyLibrary()
            using (SPSite oSPSite = new SPSite(SiteUrl))
                using (SPWeb oSPWeb = oSPSite.RootWeb)
                    Guid ID = oSPWeb.Lists.Add(SurveyListName, SurveyListName + System.DateTime.Now.ToString(),
                    SPList oSPList = oSPWeb.Lists[ID];
                    oSPList.OnQuickLaunch = true;

Create a strong name for the assembly ‘CreateActivityDemo’.

Right click on the CustomWorkflowActivityDemo project and Add —> SharePoint Mapped Folder

Navigate to Template1033Workflow and Select it.

custom activity4

Create an XML file called ‘CreateActivityDemo.Actions’ under the workflow folder. Complete the definition of ‘CreateActivityDemo.Actions’.The definition of ‘.Actions’ file is responsible for making the custom workflow activity appear in the SharePoint Designer 2010.
  <Actions Sequential="then" Parallel="and">
    <Action Name="Create Survey List"
        Assembly="CreateActivityDemo, Version=,
           Culture=neutral, PublicKeyToken=38b1d60938e39f46"
        Category="Sundar Activity">
      <RuleDesigner Sentence="Survey List Name %1 to site %2.">
        <FieldBind Field="SurveyListName" Text="Survey List Name"
           DesignerType="TextArea" Id="1"/>
        <FieldBind Field="SiteUrl" Text="Url of base site" Id="2"
        <Parameter Name="SurveyListName" Type="System.String, mscorlib"
      Direction="In" />
        <Parameter Name="SiteUrl" Type="System.String, mscorlib"
      Direction="In" />


Next, we need to add the assembly for custom workflow activity in the Package.

Double click on the Package.package

custom activity5
Click ‘Advanced’ in Package Designer.
Add a Safe Control for Workflow Activity Assembly ‘CreateActivityDemo’.
custom activity6
Create an authorized type entry for the CreateActivityDemo assembly (custom workflow activity assembly).
<authorizedType Assembly="CreateActivityDemo, Version=, Culture=neutral, PublicKeyToken=38b1d60938e39f46" Namespace="CreateActivityDemo"
 TypeName="*" Authorized="True" />
Deploy the Solution. Now we’ll see the custom activity ‘Create Survey List’ appearing in the SharePoint Designer 2010 under actions.

custom activity7



The custom workflow activity  ‘Create Survey List’ is ready to be tested.


Create a re-usable workflow and drop the ‘Create Survey List’ activity.


Set the Values for SiteUrl and SurveyListName.

custom activity8[5]


Start the Workflow.


custom activity 9


Now the Survey is created in the site with defined name.


custom activity 10

This completes the development of custom workflow activity.

 Subscribe to my post