Rkapiljith's Blog

My SharePoint experiments…

SharePoint 2016 Service Account’s

The significance on why we need Service Account’s while installing SharePoint.

We all know the standard count of service accounts needed as part of setting up SharePoint. We can define the security based on low, medium and high priority. In my opinion the following accounts are good to go even on the latest SharePoint 2016(beta 2) with Release Candidate.

Part A: Have a look at the database accounts…

Note: SQL Server 2014 SP1, 64 bit or SQL Server 2016 can be used as your database storage machine.

The need of a service account comes here for installing SQL instance and also for running its supports services like MSSQLSERVER and SQLSERVERAGENT. But the installation of SQL instance requires an account who should be the member of local administrator group. So handling with one service account exclusively for SQL installation is good. But reusing it for running SQL services like MSSQLSERVER and SQLSERVERAGENT could be a treat since account holds the local administrative permission. Due to this my suggestion is to create a separate service account exclusive for running these SQL services. As you know one of the big architecture difference after MOSS 2007 was the usage of different services with different service accounts. So even one service fails it will not impact others services and same in the case of the accounts too. Avoiding inter-dependency is achieved using this model. For setting a high secure machine you can create two separate service account for each SQL service of MSSQLSERVER and SQLSERVERAGENT.

 

 

Low Secure 1.    Create a single service account SQL_Admin would be good. This is used for installing SQL server as well as for running the SQL services like MSSQLSERVER and SQLSERVERAGENT.
Note: Ensure to provide SQL_Admin as a member of the local administrator group. Also this service account need to be a domain user and not a local user in the machine.
Medium Secure 1.    Create a service account SQL_Admin which can be used for installing SQL server instance. This service account will be a member of the local administration group.

2.    Create another service account SQL_Services which can be used for the following SQL services MSSQLSERVER and SQLSERVERAGENT.

Note: Here only the SQL_Admin account would be the member of the local administrator group. Also both service account’s need to be a domain user and not a local user in the machine.
Highly secured 1.    Create a service account SQL_Admin which can be used for installing SQL server instance. This service account will be a member of the local administration group.

2.    Create another service account SQL_Engine which can be used for the following SQL service Database engine.

3.    Create another service account SQL_Agent which can be used for the following SQL services SQLSERVERAGENT.

Note: Here only the SQL_Admin account would be the member of the local administrator group. And all three service account’s need to be a domain user and not a local user in the machine.

 

Part B: Have a look at the SharePoint accounts…

Here we need multiple accounts for managing the installation of SharePoint and its various services. We can classify the instance based on its security level as low, medium and high priority. For a low secure environment or standalone instance we can accommodate it using a single service account which will manage the entire installation and its related configurations. But in case of a medium and highly secured installation model it is good to have two separate service account with one handles the installation of the binaries and running the configuration wizards and the other account can be used configuring and managing the server farm/Run the Microsoft SharePoint Foundation Workflow Timer Service/ Act as the application pool identity for the SharePoint Central Administration Web site.

Low Secure 1.    Create a single service account SP_Farm would be good. This is used for the following tasks.

·         Install SharePoint binaries

·         Running the SharePoint Product Configuration wizard

·         Configure the Central Administration web site

·         Configure and manage the server farm

·         Act as the application pool identity for the SharePoint Central Administration Web site

·         Run the Microsoft SharePoint Foundation Workflow Timer Service

Note: Ensure to provide SP_Farm as a member of the local administrator group in the SharePoint Server box. In addition this account needs the permissions of SecurityAdmin and DB_Creator rights on the SQL Instance. Also this service account need to be a domain user and not a local user in the machine.
Medium Secure

Or

Highly secured

1.    Create a service account SP_Admin which will manage the following tasks.

·         Install SharePoint binaries

·         Running the SharePoint Product Configuration wizard

2.    Create another service account SP_Farm which could manage the following tasks.

·         Configure and manage the server farm

·         Act as the application pool identity for the SharePoint Central Administration Web site

·         Run the Microsoft SharePoint Foundation Workflow Timer Service

Note: Here only the SP_Admin account would be the member of the local administrator group and also requires SecurityAdmin and DB_Creator rights on the SQL Instance. And both service account’s need to be a domain user and not a local user in the machine.

 

 

Part C: Have a look at the SharePoint service accounts…

We now have to go with multiple service accounts which need to be used for running various application pool, service application pool, search service crawling, user profiles etc.

Section 1: In case of application pool we can refer the below reference.

Low Secured

Or

Medium Secured

Or

Highly Secured

1.    Create a separate service account SP_Pool which could be used for running the application pools (This takes our internal job of handling the request and responses for our site). Read more on IIS to learn more on application pool.

·         While we create a web application using Central Administration site we need to create a pool for it, that time we can select this account.

Note: Ensure that this service account need to be a domain user and not a local user in the machine.
Low Secured

Or

Medium Secured

Or

Highly Secured

1.    Create separate service account SP_Services which could be used for service application pools.

·         While we create service applications say while we create Managed Metadata Service and create its application pool as this service account.

Note: Ensure that this service account need to be a domain user and not a local user in the machine.
Low Secured

Or

Medium Secured

Or

Highly Secured

1.    Create separate service account SP_Crawl which could be used for search service application to crawl the contents.

·         This service account will also run the SharePoint Search windows service in case of low secured infrastructure. For medium and highly secured farm it will create a separate service account with which it will run the SharePoint Search windows service.

Note: Ensure that this service account need to be a domain user and not a local user in the machine.
Medium Secured

Or

Highly Secured

1.    Create separate service account SP_Search which will be used for running the SharePoint Search windows service.
Note: Ensure that this service account need to be a domain user and not a local user in the machine.
Low Secured

Or

Medium Secured

Or

Highly Secured

1.    Create separate service account SP_UserProfiles which can be used by user profile services to sync with Active Directory.
Note: Ensure that this service account need to be a domain user and not a local user in the machine. But this account need to have Replicate Directory Changes rights on the Active Directory for synchronization activities.
Highly Secured 1.    Create separate service account SP_MySitePool which can be used for the web application pool for My Sites.
Note: Ensure that this service account need to be a domain user and not a local user in the machine.

 

In addition to these, we can have various service accounts which can be used when we need additional services like excel services/ performance point services/ access services/ analytical services/ workflow services etc.

Account name Role SQL Permissions
sql_ssas Account with which we run the SQL Server Analysis Service services. db_datareader
sp_excel Account with which we run the Excel services.  
sp_pps Account with which we run the PerformancePoint services.  
sp_accsvc Access Services. Used to create all Access databases in SQL and the service account running the service app pool for the Access Service Application. db_owner, public, and securityadmin
sp_workflow Account with which we run the Workflow Manager service.
  Note: Ensure that these service account need to be a domain user and not a local user in the machine.

 

 

 

 

Configure a SSRS Report Portal using SQL server 2008 R2

Today we will have a check on how to configure SQL Server Reporting Services(SSRS) Report Portal using SQL server 2008 R2. With SSRS Reporting Services, you can create interactive, tabular, graphical, or free-form reports from relational, multidimensional, or XML-based data sources. Reports can include rich data visualization, including charts, maps, and sparklines. You can publish reports, schedule report processing, or access reports on-demand.

Let us see how we configure it.

I assume that your server already have the SQL server 2008 R2 instance.

  • From windows menu>> All Programs >>Microsoft SQL Server 2008 R2>>Configuration Tools>>Reporting Services Configuration Manager

  • Provide your SQL server name, if needed use the Find button to identify it.
  • Click the Connect button.
  • Now from the left side navigation bar click the menu Service Account
  • On the right side for the section Report Server Service Account for the option Use built in Account select Network Service
  • From the bottom area click the Apply button
  • If you wish to use Domain Account please go ahead… no body is there to block you 🙂

  • Now we will go to the section Web Service URL where we have to fill in the Virtual Directory name as what we needed then IP address as All Assigned(Recommended) and TCP Port  as 80 and  if needed go for the SSL options too.
  • Click the Apply button

  • Now we will go to the section Database where we have to fill the section Current Report Server Database

  • Click the button for Change Database

  • Select the option for create a new report server database and click the Next button
  • Check your server name is correct or not and also check Authentication Type as Current User (Integrated Security)
  • Now click the Test Connection button to test the connectivity
  • Once you find it was succesfull then click the Next button

  • Now in the next screen enter your Database Name which you wish to have and also use the Report Server Mode as Native Mode and click the Next button
  • And with the next screen for Credentials use the Authentication Type as Service Credetials and click the Next button
  • So now we have our Database to go with… so click the Finish button.
  • Now we will configure our Report Manager URL section
  • Provide a name to the Virtual Directory and click the Apply button

  • Now for the section Email settings fill the sender email address and your SMTP server name and click the Apply button

  • Now for the Execution Account section provide the account details with password too…then click the Apply button

  • Now for the Encryption key section we will provide a backup provision.Click the Backup Button
  • Input a file location and name for saving the backup. Also provide a password which needs to be complex 8 letter alphanumeric password.

  • Click the OK button followed by Apply button also
  • Check other regions and understand what all are configured so far

So we will go for browsing our SSRS for the first time.

  • Go the section Report Manger URL and click the URL what we have configured there. This will open our SSRS portal

But for some user i have noticed that the webportal won’t work and give error as “Unable to connect to remote server”

To resolve this we need to identify the config file “rsreportserver“. For my windows seven machine i located this config file from C:\Program Files\Microsoft SQL Server\MSRS10_50.MSSQLSERVER\Reporting Services\ReportServer

Open the file rsreportserver in a notepad and change the value of SecureConnectionLevel from 2 to 0

Before the change

<Add Key=”SecureConnectionLevel” Value=”2″/>

After the change

<Add Key=”SecureConnectionLevel” Value=”0″/>

Browse the same URL once again…it will open your SSRS portal

Enjoy your SSRS Portal 🙂

Cheers,

Kapiljith Rajappan.

Managed Client Object Model using SharePoint 2010

In SharePoint 2010 there are 3 ways you can enable Client Object Model’s usage.

  1. Managed Client Object Model
  2. ECMA Scripts(JavaScript, JScript)
  3. Silverlight Extensions

Today i am going to discuss the 1st method using Managed Client Object model. From the word itself it defines the importance of a managed behaviour. Yes using this Managed Client Object model help us to write applications that are based on the .NET Framework and access SharePoint content from clients systems without installing code on the server that runs SharePoint 2010.

Eg: Moving a list item from a SharePoint list to another without any code deployment on servers that runs the SharePoint.

In the classic Server object model type we have to write the code for the above example and deploy the exe file/setup on the server where our SharePoint servers are installed. So by this new approach you can run the exe file/setup from any of your client system and accomplish your job without touching your server where you hosted SharePoint 2010.

So let us see what is the architecture which is helping us to accomplish this method.

The client Object Model bundles the various API calls (eg CAML query/Call various methods) and pass it to the server that runs the SharePoint via webservices. The server receives these request, and makes appropriate calls into the object model on the server, collects the responses, forms them into JavaScript Object Notation (JSON), and sends that JSON back to the SharePoint managed client object model. The client object model will parses the JSON and presents the results to the application as .NET Framework objects (or JavaScript objects for JavaScript). This is what is defined in the above diagram.

Now i will demonstrate it with a Windows console application.

  • Start Microsoft Visual Studio 2010
  • From the File menu >> New and then click Project

  • Select the Windows >> Console Application

  • Now we have to add the following DLL references for Microsoft.SharePoint.Client.dll and Microsoft.SharePoint.Client.Runtime.dll. Both these DLL’s are residing in “C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\ISAPI

  • Now include the library using Microsoft.SharePoint.Client;
  • Include the code snippet as shown below
using System;
using System.Collections.Generic; 
using System.Linq; 
using System.Text; 
using Microsoft.SharePoint.Client;
namespace HPManagedClientObjectModel 
{     
                          class Program     
                         {         
                                           static void Main(string[] args)         
                                          { 
                                                         ClientContext clientContext = new ClientContext("http://krajappan.sharepoint.com/");             
                                                         Web site = clientContext.Web;             
                                                         clientContext.Load(site);             
                                                         clientContext.ExecuteQuery();             
                                                         Console.WriteLine("Title\t\t:\t{0} \n Description\t:\t{1}", site.Title,site.Description);
                                                         Console.WriteLine("End");             
                                                         Console.ReadLine();         
                                           }     
                             } 
}
  • Now try to execute your Console application (F5 shortcut Key)
    You will get the results like, Title and Description of the SharePoint Site 🙂

SharePoint 2013 installation steps(Virtual Machine).

This post is to to help those who are interested with the latest version of SharePoint 2013. Exclusive for developers, admin people please excuse me 😦

I am trying to install my sharepoint 2013 on a virtual machine.

Before our installation we should check our Host machines (My system configuration is a Windows 7 64 bit withEnterprise edition) capability to host SharePoint 2013. We can check it using Intel’s utility application which can be downloaded from the below URL.

http://www.intel.com/p/en_US/support/highlights/processors/toolspiu/

This utility will check the following items are enabled or not. If not enable it accordingly using your BIOS screens.
>>   Enabled with 64 bit version of OS or not
>>   Enabled with Hyper-Threading Technology
>>   Enabled with Virtualization Technology

My host machine is Windows 7 64 bit (Enterprise version). I downloaded my best buddy… Virtual Machine from Oracle(Earlier Sun’s Sandbox) Virtualbox(Oracle VM).This is free to download from the below URL.

Download virtualbox from Oracle website : http://www.oracle.com/technetwork/server-storage/virtualbox/downloads/index.html

Platform/ OS Details   : Windows (32-bit/64-bit)

I don’t wish to explain the Virtula machine’s installation steps. Please refer the below link for more information about how to create a virtual machine with Windows 2008 R2(64 bit)

http://www.sysprobs.com/install-run-windows-2008-r2-x86-sun-virtualbox

Try to mount the Windows 2008 setup in ISO format so that you can mount it easily. You can download Windows 2008 R2 from Microsoft which is an evaluation copy for 90 days.

Once installation is completed… i mean when you are ready with your VirtualBox with Windows 2008 R2 server. Try to install the below softwares too.

  • Windows      SQL server 2008 R2
  • IIS 7.0 or above
  • Microsoft KB artciles KB  2554876 and KB 2708075
First try to install the prerequisiteinstaller

Image

Double click >> prerequisiteinstaller >> Click the Run botton

Now click the Next button

Now accept     the License Agreement(s) by selecting the tick mark and then click Next button

Now  click Finish button and proceed with a system restart .

Now we restarted our machine and proceed with the actual SharePoint 2013 installation steps.

Double click the setup

Enter the Product’s serial key and click the Continue button

Now accept     the License Agreement(s) by selecting the tick mark and then click Continue button

Select the stand-alone version  and then click Install Now button

If you check the “File location” tab you will see the new physical path with a reference to the 15 folder.

SharePoint 2015               –              15 folder

SharePoint 2010               –              14 folder

SharePoint 2007               –              12 folder(Hive)

Select the check mark for Sharepoint   Configuration Wizard and then click the Close button

Click the Next button

Click the Yes button

We all know this is a Beta version of this product and may surprise us with some bugs. So here comes one of the issue and its work around to resolve it.

Here the culprit is the permisson in SQL server. Hope you already installed the SQL Server Management Studio

Open SQL Server Management Studio  >> Security >> Logins >>   {Select your logged in user account for SharePoint installation} >> Server Roles >>Select the check mark for “setupadmin

 Now  from   windows start menu >>Select    Run>> Cmd >>Press the enter key>>cd “C:\Program   Files\Common Files\Microsoft Shared\Web Server Extensions\15\BIN”

 psconfig.exe -cmd   Configdb Create SkipRegisterAsDistributedCacheHost

Further to this we will face another issue when we reach configuring the 8th item. I am unable to resolve it.SQL server is the culprit. I dont wish to reinstall my SQL instance. So i am going ahead with my Central admin portal to check my SharePoint 2013 instance, since before this error i see my central admin site is provisioned.

Don’t get frustrated by this error. Please go ahead and start accessing your Central administration site and create your web application>> site collection>>and your base site by using any available template and enjoy your first SharePoint 2013 website 🙂

This is a Beta version so please expect errors and post it acrosss the forums to get a quick solution to fix it 🙂

Cheers,

Kapiljith Rajappan

A walkthrough on the latest release of SharePoint 2013

Yes Mircrosoft’s latest baby’s scan results are out. It is named as SharePoint 2013(Beta is available for your testing).

Software requirement for installation:

Windows Server 2008 R2 Service Pack 1 or Windows 8 Server

Prerequisites

  • Windows Identity Foundation v1.1
  • Microsoft Information Protection and Control Client
  • Microsoft WCF Data Services
  • Windows Management Framework 3.0
  • Application Server Role
  • Web Server (IIS) Role
  • Microsoft .NET Framework 4.0
  • Update for the .NET Framework 4 (KB2468871)
  • Microsoft SQL Server 2008 Native Client
  • Windows Identity Foundation (KB974405)
  • Microsoft Sync Framework Runtime v1.0 (x64)
  • Windows Server AppFabric

Database server

Microsoft SQL Server 2008 R2 (Service Pack 1) 64bit or Microsoft SQL Server 2012 (64bit)

SharePoint 2013 Overview

http://sharepoint.microsoft.com/en-us/preview/default.aspx

Download Microsoft SharePoint Server 2013 Preview

http://technet.microsoft.com/en-US/evalcenter/hh973397.aspx?wt.mc_id=TEC_121_1_33

Useful links

  • Step by Step: Install SharePoint Foundation 2013 Preview

http://www.denisstadler.com/sharepoint-2013/step-by-step-install-sharepoint-foundation-2013-preview/

How to run your Javascript code automatically in SharePoint 2010

Have you ever tried to run the Javascript code automatically from SharePoint?

Say you have a scenario like this: you need to dynamically create a navigation menu per sites in SharePoint. So the first approach would be writing the code part in your master page. How about writing client object model rather than any delegate controls for this purpose.

So the approach is to use javascript custom functions in master page. Let me try how it behave inside a Content Editor webpart in SharePoint.

  • Click the edit option in your SharePoint page
  • Add your Content Editor webpart
  • Insert the below line of code

<script type=”text/javascript”>
function activeMonth()
{
document.getElementById(‘monthDiv’).innerHTML=”July”;
}
window.onload=activeMonth;
</script>

<div id=”mainDiv”>  

The active month of the year 2012 get changed from June to <div id=”monthDiv”><b>June</b></div>

</div>

  • Save the changes and publish the page.

So here goes the brief of this code… During the page load we are calling the function “activeMonth”. The activeMonth function will change the content of the DIV on the fly. The output will give us a a result like “The active month of the year 2012 get changed from June to July” .

Problem

Once we use this piece of code in SharePoint CEWP and try for re-editing the page/webpart our SharePoint Ribbon Control become disabled and sometime we can’t even see the output along with no vertical scroll options. I tried but can’t suceed to find the real problem in my source code :-(. Seems like the code “window.onload=”  may be the culprit behind it. This is breaking my HTML rendering mechanism.

Solution

To resolve this problem i use the JQuery to call the function.

  • To edit the page i appended the active page’s url with “?contents=1”. This is going to help me to display all the active webparts available in that page.
  • Close/Delete the earlier CEWP which we added with the autorun javascript.
  • Now we will place our new JQuery code for the same. Rememeber to add your JQuery reference for this functionality(The first line is JQuery reference from my SharePoint library). 

<script src=”/Style%20Library/JQuery/jquery-1.7.2.min.js” type=”text/ecmascript”></script>
<script type=”text/javascript”>  
$(document).ready(function()
{
activeMonth();
});
function activeMonth()
{
document.getElementById(‘monthDiv’).innerHTML=”July”;
}  
</SCRIPT>
<div id=”mainDiv”> 
The active month of the year 2012 get changed from June to <div id=”monthDiv”><b>June</b></div>
</div>

  • Save and publish the page to see the output screen

Hope you will enjoy this mechanism for your custom requirements too .

Have a great time.

Cheers,

Kapiljith Rajappan

DataView webpart in Sharepoint 2010

Today i am writting OTB dataview webpart and its implementation in SharePoint 2010. This webpart is only available in SharePoint Designer tool.

You might have gone through some requirement like customized look and feel without any custom coding to display items from a list. For building the custom GUI you have to format the XSLT. So here goes the simple steps to achieve it…

  • Open your website in SharePoint Designer 2010
  • Create a page inside your Pages Library(Here i created a page called as “FOURTH.aspx”)
  • Now from Designer >>Pages library>><select your page>>>Detach from Page Layout

  • We need to detach to place our data View webpart
  • Now Check out the file and start editing the file
  • To render all avaiailbe HTM markup’s we will select the option “Edit in Advanced Mode” from the SharePoint Designer ribbon

  • Select the area where you wish to place your DataView webpart.I choose to have it in my “Header” webzone area
  • From the ribbon select the “Insert” Tab >>Expand the menu for Data View Icon>>Empty DataView

  • Now we have to attach a data source. For doing it from the design view we will select the link for “Click here to select a data source

  • Now a popup window will appear and select your desired list library and click the Ok button

  • Now from the right side panel you can filter the source fields which you wish to display in the page
  • Use the function key Ctrl to select multiple field items
  • Once your selection process is over from the dropdown section select the option as “Insert Selected Field as” and click the field to view its sub menu items. Select the option for “Multiple Item View” to watch the multiple itenaries

  • The output is visible from the Designer itself. If anything went wrong the designer will throw error too. This is helping us a lot to see the intermediate output before publishing the page

  • Now we will check the XSLT part. From the designer “code” view identify your XSLT part which render the HTML outputs. Modify that section using DIV or HTML table structure to bring your new look and feel

  • Now i modified the XSLT as given below

  • I just made modification using the Table/TR/TD structure…
  • In addition to this we will provide a link to see the full details of the list item. For doing so identify the item which you wish to place a hyperlink then right click from design view >>select the option “Format Item as” >>”HyperLink to” >>”Display Form

  • But i will go for another “Read more” link for this purpose

  • See your output in desiner’s design view.
  • Here one important thing when you add xslt properties make sure that you are not adding any line breaks otherwise it add carriage returns and line spaces and break your intended HTML output. For example write it in single line as<xsl:attribute name=”Title”>Read more by this clicking this link</xsl:attribute>  rather than in 3 different lines

<xsl:attribute name=”Title”>

Read more by this clicking this link

</xsl:attribute>

  • Now save the page and publish a major version to see your output screen like the below item

  • Clicking on the Read More link will take you to the page for reading other details of the selected item.

Now we will see how we can set sorting/filter in data view webpart

  • Once you open your dataview webpart in SharePoint designer  using the advance mode.
  • Select your dataview webpart from the designer. The selected Data Source property pane will be available on the right side.

  • Click the selected list and now you will see another popup window to selecting your desired fields/putting filtering conditions/select your sort condition

  • Click the Fields button and use the Add/Remove/Moveup/Move down options according to your need
  • For filter use the Filter button and add the condition you wish to accomodate

  • Here in my screen i added a condition to filter all items where the brief value is equal to “Brief about the 13th item.
  • And regarding sort i wish to sort it in ascending order of its Title

  • Now see the ouput screen which defines my query . The output will be visible within the Designer’s design view

  • Now save and publish a major version of the page to view the output screen.

Note: If you have more than 10 items then you can see the pagination component in the dataview webpart. This will appear in your GUI automatically without any further modification.

Enjoy your developement hours!!!

Cheers

Kapiljith Rajappan

Change the Ribbon color in SharePoint 2010

Most of us start GUI changes by giving a color change for ribbon control. For doing so the best way is override the css styles with your own css class. Alternatively you can make the change in your orginal copy of CORE4.css.

If you don’t mind changing the actual file please proceed like this. This is going to affect all sites in the farm. Assuming you installed the default as English language(1033). Open the file CORE4.css from “C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\TEMPLATE\LAYOUTS\1033\STYLES\Themable” replace all “#21374C” with your desired color say “#FE6B01” and save your file to see the new ribbon in action.

Cheers,

Kapiljith Rajappan

How to add additional welcome menu items for SharePoint 2010

Here we will check how to introduce a new menu item to the SharePoint Welcome menu.

  • Open your Visual Studio 2010
  • Create a new project(File >>New>>Project)
  • Select the type as “Empty SharePoint Project” and give a proper solution name “CustomWelcomeMenu”
  • Provide your web URL
  • Select your type as “Farm” deployment
  • Now add a new feature item
  • Give required information to this feature using the design mode. Change the Scope to deploy in “Farm” level

  • Now we change the name of feature file. For doing this from solution explorer we will select the “Properties”
  • Change the name of the feature as required “CustomWM” and press teh enter key. You can see the changes for other files using Solution explorer.

  • Now we need to attach an element to our feature. For doing so we will add a new Element file.

So now if we check our solution explorer we can find our element file get attached to our Feature file.

Now we need to focus on our element file. Use the following code snippet

<?  xmlversion="1.0"encoding="utf-8"?> <  Elementsxmlns="http://schemas.microsoft.com/sharepoint/">   <  CustomAction     Id="customWMItem"     GroupId="PersonalActions"     Location="Microsoft.SharePoint.StandardMenu"     Sequence="1000"     Title="Ente Library"     Description="Open Style Library"     ImageUrl="_layouts/images/KapiljithRajappan.png">     <  UrlActionUrl="~site/Style%20Library"/>   </  CustomAction> </  Elements>

Here i used my own picture which i created using 32×32 KapiljithRajappan.png file and placed in “C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\TEMPLATE\IMAGES”.

Now we can proceed with the deployment activities. Built the project(F6) and make sure there is no error in the solution. Deploy the same from visual studio and open your Central admin site to see the feature get deployed correctly. This feature is scoped in Farm level. You can change the scope according to your need(site/web/webapp/).

From Central Admin >>System Settings(From Quick links) >>Manage Farm solution.

Since the solution is deployed globally we can see our new expected menu like this from Welcome button.

How to open the Welcome menu links in a Modal Popup Window

Do you wish to open your link in a modal popup dialog window? If so edit your element file and append the UrlAction Url property as

<UrlAction Url="javascript:OpenPopUpPageWithTitle('<Your url to open>',RefreshOnDialogClose,<Your popups Height>,<Your popups Width>,'<Your caption here>')"/>

So here in my case it will look like the below code snippet.

<?xml version="1.0" encoding="utf-8"?>  <Elements xmlns="http://schemas.microsoft.com/sharepoint/">   <CustomAction   Id="customWMItem"   GroupId="PersonalActions"   Location="Microsoft.SharePoint.StandardMenu"   Sequence="1000"   Title="Ente Library"   Description="Open Style Library"   ImageUrl="_layouts/images/KapiljithRajappan.png">   <UrlAction Url="javascript:OpenPopUpPageWithTitle('{SiteUrl}/Style%20Library',RefreshOnDialogClose,800,700,'Kapil Modal Popup Window')"/>   </CustomAction> </Elements> 

Now my output looks like the below snapshot, which is opened in a Modal window.

How to remove links from Welcome Menu

But some of the users may ask us to remove some of the default links from the Welcome menu. So for accomplishing those kind of requirement we will take use of JQuery.

  • Open your master page in SharePoint Designer 2010
  • Make sure you have the JQuery files installed properly to the site
  • Make sure your master page have the proper jQuery reference in master page
<!--START Added by Kapiljith Rajappan for JQuery --> <script type="text/ecmascript" src="/Style Library/JQuery/jquery-1.7.2.min.js"></script> <script type="text/javascript"> if (typeof jQuery == 'undefined') {  document.write(unescape("%3Cscript src='/_LAYOUTS/JQuery/jquery-1.7.2.min.js' type='text/javascript'%3E%3C/script%3E")); } </script> <!--END Added by Kapiljith Rajappan for JQuery -->
  • Add the following code snippet  before the end of </head> tag
<script type="text/ecmascript">  jQuery(document).ready(function($) {  var objects = document.getElementsByTagName("ie:menuitem");  for (var i = 0; i < objects.length; i++)  {       itm = objects[i];   if ($('#' + itm.id).attr("text") == "Sign in as Different User")   {    $('#' + itm.id).remove();   }  } });    </script>
  • Save and publish the master page
  • This will remove the menu item “Sing in as Different User“.

Another workaround for this would be making changes direct to the welcome.ascx file. You can find the file from the location  “C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\TEMPLATE\CONTROLTEMPLATES“.

  • Open the file in any text editor
  • Add the attribute visible=”false” for the required field
  • Save the file and see the changes

Here i removed the logout link from welcome.aspx

Now my output screen will look like this one.

Cheers,

Kapiljith Rajappan

Identify the Ribbon controls in SharePoint 2010 master pages

When you try for a customized master page there are serious of doubts disturbs your mind. The master page is full of delegate controls and placeholders. So identifying the ribbon control will eat our time.

So let us have a look from the v4.master.

  • Open your site in SharePoint desinger 2010
  • copy the v4.master and rename it as “Ribbon.master”
  • Now find the word “<div id=”s4-ribbonrow”
  • This DIV is responsible for rendering the entire ribbon controls.

Snapshot of Ribbon controls from the masterpage:

If we divide our master page into two portion as header (Ribbon area) and body area. Please identify the same using the below snapshot.

So if i further subdivide and place these controls inside a table as given below …it will be more understandable for you guys.

After making these changes and publishing the master page will give us the output screen like the below snapshot.

Now we will identify the code for SiteActions button and menu.We can find this code snippet within the Ribbon control’s portion.

If we hide this SiteActions in masterpage we will get an ouput like this.

Now we will check the code for Welcome menu(Top Rightmost menu items). We can find its code snippet within the Ribbon control’s portion.

We will hide(comment) these portion using SharePoint Designer 2010.

After making these master page changes the output screen will look like this. So no more Welcome menu for our SharePoint site 🙂

Design a site like this with WordPress.com
Get started