Friday 11 October 2013

SharePoint 2010 Interview Questions for Administration

Q. How is BCS Different from BDC in SharePoint 2007 ?

Ans. Even though the BDC made it relatively easy to create read-only solutions that display data in the Business Data List Web Part, it was not so simple to create a solution that enabled users to make changes and write that data back to the external store.BCS, on the other hand, provides you with Read-Write capable connectivity from Client and Server to Database, WCF/Web Services and .Net Sources. A Developer can now use SharePoint Designer 2010 and VS 2010 rapid development tools to access
external data.

Q. How would you create an Information Site in SharePoint 2010?

Ans. In SharePoint 2010 You can create a Read-Only Farm/site or site-collection by setting the Content database as Read-only.In SharePoint 2010 You can create a Read-Only Farm/site or site-collection by setting the Content database as Read-only.In a read-only farm, only content databases are read-only. All other databases, including the configuration database, Central Administration content database, and search database, are read/write.
The site collection that is associated with a read-only content database is automatically set to be read-only.

The user experience of a read-only site is characterized by the following:

* Common tasks that do not require writing to the content database are fully available.

* Most of the common tasks that require writing to the content database are not available, either because they have been
disabled in the user interface or because the user is no longer allowed to apply changes.

* Some common tasks that require writing to the content database appear to be available, but return errors.

Q. What would you clean up before upgrading to SharePoint 2010?

Ans. Before you begin upgrading from Microsoft Office SharePoint Server 2007 to Microsoft SharePoint Server 2010, you should make sure that your environment is functioning in a healthy state and that you clean up any content that you do not have to upgrade.Before you begin upgrading from Microsoft Office SharePoint Server 2007 to Microsoft SharePoint Server 2010, you should make sure that your environment is functioning in a healthy state and that you clean up any content that you do not have to upgrade.

Clean Up - Before Upgrading to SharePoint 2010 

Look for some things before you start upgrading stuff

* Delete unused or underused site collections and sites.
You do not want to upgrade content that you do not have to keep. If it has been unused for a long time and will not be needed in the future, back it up, and then delete it to free storage and administrative resources, improve upgrade performance, and reduce upgrade risk.

* Remove extraneous document versions

Large numbers of document versions can slow down an upgrade significantly. If you do not have to keep multiple versions, you can have users delete them manually or use the object model to find and remove them.

* Remove unused templates, features, and Web Parts

Firstly,verify that no sites are using any template, feature, or Web Part. You can use the pre-upgrade checker (Stsadm -o preupgradecheck) and the Stsadm -o EnumAllWebs operation to identify these customizations in your environment. If you are not using any customization, then you should delete it.

* Address large lists

By default, large list query throttling is appliedafter an upgrade to SharePoint Server 2010. If a list is very large, and users use a view or perform a query that exceeds the limit or throttling threshold, the view or query will not be permitted.Check any large lists in your environment and have the site owner or list owner address the issue before upgrade. For example, they can create indexed columns by using filtered views, organize items into folders, set an item limit on the page for a large view, or use an external list.

Q. What are the Hardware and Software requirements for SharePoint 2010.?
Ans.
Hardware requirements :
# Processor 64-bit, four-core, 2.5 GHz minimum per core.
# RAM 4 GB for developer or evaluation use, 8 GB for single server and multiple server farm installation for production use.
# Hard disk 80 GB for installation
For production use, you need additional free disk space for day-to-day operations. Add twice as much free space as you have
RAM for production environments.

Software requirements :
# The 64-bit edition of Windows Server 2008 Standard with SP2. If you are running Windows Server 2008 without SP2, the
Microsoft SharePoint Products and Technologies 2010 Preparation Tool installs Windows Server 2008 SP2 automatically.

Q. What Has Changed with SSP in SharePoint 2010.?

Ans. In SharePoint 2010 Shared Service Providers (SSP's) are replaced by Service Applications. Services are no longer combined into a SSP. They are running independent as a service application. The service application architecture is now also built into Microsoft SharePoint Foundation 2010, in contrast to the Shared Services Provider (SSP) architecture that was only part of Office SharePoint Server 2007.
A key benefit here is that all services are installed by default and there is no SSP setup.
Additional improvements for the service application model include:

• The services architecture is extensible, allowing third-party companies to build and add services to the platform.
• Services are managed directly in Central Administration (rather than a separate administration site).
• Services can be monitored and managed remotely.
• Services can be managed and scripted by Windows PowerShell™.
• Shared services communications take place over HTTP(S). Shared services do not directly access databases across farms.
• Most new services are built on the Windows Communications Framework. They have optimization built into their protocol,
using binary streams instead of XML for data transfer. Test results show improvements in network throughput with this change.

Q. What are the advantages of Service Applications over SSP ?

Ans. The key limitation of the SSP architecture was that it was configured by using a set of services, and all Web applications associated with the SSP bore the overhead of all the services even if they weren’t being used. To change the service configuration for a particular Web application, a new SSP would have to be created.The service application architecture on the other hand, allows a set of services to be associated with a given Web application and a different set of services to be associated with another Web application. Also, the same service application can be configured differently in different Web applications; therefore, Web sites can be configured to use only the services that are needed, rather than the entire bank of services.

Q. Can we create a Single set of Services that will be shared across the farm?

Ans. Similar to the SSP model in Office SharePoint Server 2007, a single set of services can be shared by all sites in a farm. By publishing a service application (from the sharing group, under Service application tab), you can share it across server farms. This capability does not apply to all service applications, and some services can be shared only within a single server farm.

Q. What are Managed Accounts?

Ans. To reduce the load of managing various service accounts in Microsoft SharePoint Server 2010, the concept of managed accounts has been introduced. Much like managed accounts in Windows Server 2008, they allow SharePoint Server to take control of all the service accounts you use. After SharePoint Server has control of these accounts, it can either manage their passwords — automatically changing them as necessary — or it can notify you when an accounts password is about to expire,
allowing you to make the change yourself.

Q. What are the Methods of Backup and Recovery in SharePoint 2010?

Ans. Microsoft SharePoint Server 2010 provides a broad range of levels for performing backups, including the entire farm, farm configuration information, site collections, subsites, or lists.

SharePoint Server 2010 uses two different tools to configure backup and recovery.

1. Central Administration : Central Administration provides a user interface where SharePoint Administrators will be prompted
via menu structures to select the information that needs to be backed up. (see the Image below)

2. Windows PowerShell : Windows PowerShell is a command line tool that provides SharePoint administrators a way to perform backup and recovery with additional options such as file compression or working with SQL snapshots.

Listed below are a few of the benefits available when working with Windows PowerShell:

• Windows PowerShell scripts can be developed and scheduled (with Windows Task Scheduler), whereas Central Administration is used for single-use backups and restores.

• Windows PowerShell has the advantage of running against SQL snapshots instead of the production database. One of the parameters of the Windows PowerShell command will cause a SQL snapshot to be generated, and then Windows PowerShell will run the action against the snapshot instead of the production database. This will reduce the resource impact of the backup operation on the production environment.

• With Windows PowerShell, SharePoint administrators will have more granular control of options for the backup or restore.

Q. How to Move content Databases using PowerShell ?

AnsTo attach\detach an existing content database 
use Mount-SPContentDatabase "<ContentDb>" –DatabaseServer "<DbServer>" –WebApplication http://webapplicationname/

<ContentDb> is the content database to be attached.

<DbServer> is the name of the database server.

http://WebapplicationName is the name of the Web application to which the content database is being attached.

To detach a content database:

Dismount-SPContentDatabase "<ContentdBName>"

Q. How to Export a Site or List in SharePoint 2010?
Ans. SharePoint Server 2010 provides several new features that provide a granular level of backup for various components of site content. This includes content at the site, subsite, and list level.

Through Central Administration(Granular level Back-up) a SharePoint Administrator can configure a backup of a subsite or list. An Administrator can choose a site and a specific list to be exported.The administrators can also choose to export security and select the different versions that will be exported with the list.

Q. Changes in Themes in SharePoint 2010. Can we re-deploy and use the Old Cutsom themes in SharePoint 2010?
Ans. SharePoint Server 2010 has changed the way themes work, making them easier to customize. You can now, change colors, fonts, links etc from themes interface itself. Also, you can import PowerPoint themes directly into SharePoint Server.

Additionally, themes can now be applied to all subsites from one interface.
No, you cannot re-deploy and use your old cutsom themes in sharePoint.
Any customizations and design work that you have done with themes will not be imported into the new interface.

Q. What is Enterprise Metadata Management?

Introduction to Enterprise Metadata Management 

Enterprise metadata management (EMM) is a set of features introduced in Microsoft SharePoint Server 2010 that enable taxonomists, librarians, and administrators to create and manage terms and sets of terms across the enterprise. 
The managed metadata service: is a service application that enables the use of managed metadata and 
allows you to share content types across site collections and across Web applications. The service publishes a term store and content types, and the metadata is consumed via the managed metadata connection. A managed metadata service and connection are created when the metadata service application is created.

Managed Metadata Service Application Creating the service application requires the administrator to specify the database to be used as the term store. When you create new managed terms, or when users add managed keywords, these terms are stored in the database. Like other service applications, the managed metadata service can be published to provide access to other Web applications. 
When a service application is published, a URL to the service is created.
 The administrator of another Web application can create a connection to your service by using this URL.
In addition to sharing metadata, you can also use the managed metadata service to share content types. By creating a new managed metadata service and specifying a site collection as the content type hub, you can share all content types in the site collection’s content type gallery.

You can create multiple managed metadata service applications. This provides the capability to share multiple term stores and content types from multiple site collections. Each service must specify a different term store during the creation process, and a new database will be created if it does not exist.

Managed Metadata Service Connection The connection provides access to the service. When you create a managed metadata service, a connection to the service is automatically created in the same Web application as the service. Web applications can have connections to multiple services. Several properties are specified as part of the connection. Values for each of these properties must be specified as part of configuring the service connection.

Default keyword location Specifies that the term store will be used to store new managed keywords. This provides the capability for sharing and managing a common set of keywords across site collections.

Default term set location Specifies where to store term sets when new site columns are created. This provides the capability for sharing and managing a common set of terms across site collections.

Use content types Makes content types associated with this managed metadata service available to users of sites in this Web application.Push-down content type publishing updates from the content type gallery to subsites and lists by using the content type whether to update existing instances of the changed content types in subsites and libraries.

Q. What is Business Connectivity Services in SharePoint ?
Ans.SharePoint 2010 provides a new set of technologies known as Business Connectivity Services for retrieving, editing,updating, and deleting data from external systems(for e.g. data from ERP or CRM database). BCS enhances the SharePoint platform’s capabilities with out-of-box features, services and tools that streamline development of solutions with deep integration of external data and services.


Thursday 10 October 2013

Create List in SharePoint 2010 Programmatically Using VS 2010 Via COM

Question: What is creating a list via COM?

In simple terms "To create a new list template using the client object model".



Step 1: Open Visual Studio 2010 and select web forms application

Now two references need to be added to the application, they are:

Microsoft.SharePoint.ClientMicrosoft.SharePoint.Client.Runtime

Step 2: The complete code of webform1.aspx looks like this:

<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs"Inherits="CreateListCOMApp._Default" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
    <title></title>
</head>
<body>
    <form id="form1" runat="server">
    <center>
        <div>
            <table style="text-align: center">
                <tr>
                    <td colspan="2">
                        <asp:Label ID="Label1" runat="server" Text="Client Object Model List Creation - SharePoint 2010 Programatically"
                            Font-Bold="true" Font-Size="Large" Font-Names="Verdana" ForeColor="Maroon"></asp:Label>
                    </td>
                </tr>
                <tr>
                    <td>
                        <asp:Label ID="Label4" runat="server" Text="Please Enter List Name" Font-Size="Large"
                            Font-Names="Verdana" Font-Italic="true"></asp:Label>
                    </td>
                    <td>
                        <asp:TextBox ID="TextBox4" runat="server" Width="117px"></asp:TextBox>
                    </td>
                </tr>
                <tr>
                    <td colspan="2">
                        <br />
                        <asp:Button ID="Button1" runat="server" Text="Create List" Font-Names="Verdana"Width="282px"
                            BackColor="Orange" Font-Bold="True" OnClick="Button1_Click" />
                    </td>
                </tr>
                <tr>
                    <td colspan="2">
                        <br />
                        <asp:Label ID="Label5" runat="server" Font-Bold="true" Font-Names="Verdana"></asp:Label>
                    </td>
                </tr>
            </table>
        </div>
    </center>
    </form>
</body>
</html>

Step 3: The complete code of webform1.aspx.cs looks like this:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Microsoft.SharePoint.Client;
namespace CreateListCOMApp
{
    public partial class _Default : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            TextBox4.Focus();
        }
        protected void Button1_Click(object sender, EventArgs e)
        {
            if (string.IsNullOrEmpty(TextBox4.Text))
            {
                Label5.Text = "Please Enter Some Values";
                Label5.ForeColor = System.Drawing.Color.Red;
            }
            else
            {
                ClientContext objContext = new ClientContext("http://win-kv3bo1rqqf7:25339/");
                Web objWeb = objContext.Web; ListCreationInformation createInfo = new ListCreationInformation();
                createInfo.Title = TextBox4.Text;
                createInfo.TemplateType = (int)ListTemplateType.CustomGrid;
                List objList = objWeb.Lists.Add(createInfo);
                objList.OnQuickLaunch = true; objList.Update(); objContext.ExecuteQuery();
                Label5.Text = "List Created Successfully";
                Label5.ForeColor = System.Drawing.Color.Green;
                TextBox4.Text = string.Empty;
            }
        }
    }
}

Step 4: The output of the application looks like this:



Step 5: Data entering output of the application looks like this:



Step 6: The output of the field created SharePoint application looks like this:

Wednesday 9 October 2013

List Updating in SharePoint 2010 Programmatically Using VS 2010



In simple terms "When you create a custom list, a new empty list is created with just two columns - Title and Attachments. The list contains a single default view. Once you create the list, you can add more columns, views, and so on".

I think we are now good to go and implement this wonderful concept.

Step 1: Create a custom list and modify the view.

Step 2: Open SharePoint 2010 Central Administration and navigate to specific site.

Step 3: Open Visual Studio 2010 and create an "Empty SharePoint project":



Step 4: Select "Deploy as a farm solution" and click on the "Finish" button. Now an empty project will be created:


Step 5: Add a new visual webpart for that project:



Step 6: The complete code of visualwebpart1usercontrol.ascx looks like this:

<%@ Assembly Name="$SharePoint.Project.AssemblyFullName$" %>
<%@ Assembly Name="Microsoft.Web.CommandUI, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
<%@ Register TagPrefix="SharePoint" Namespace="Microsoft.SharePoint.WebControls"
    Assembly="Microsoft.SharePoint, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
<%@ Register TagPrefix="Utilities" Namespace="Microsoft.SharePoint.Utilities"Assembly="Microsoft.SharePoint, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
<%@ Register TagPrefix="asp" Namespace="System.Web.UI"Assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" %>
<%@ Import Namespace="Microsoft.SharePoint" %>
<%@ Register TagPrefix="WebPartPages"Namespace="Microsoft.SharePoint.WebPartPages"
    Assembly="Microsoft.SharePoint, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
<%@  Control Language="C#" AutoEventWireup="true"CodeBehind="UpdateListWebPartUserControl.ascx.cs"
    Inherits="ListUpdateApplication.UpdateListWebPart.UpdateListWebPartUserControl" %>
<div>
    <center>
        <table>
            <tr>
                <td colspan="2">
                    <asp:label id="Label1" runat="server" text="Update List Data via Object Modelling - SharePoint 2010"
                        font-bold="true" font-size="Large" font-names="Verdana" forecolor="Maroon"></asp:label>
                </td>
            </tr>
            <tr>
                <td>
                    <asp:label id="Label6" runat="server" text="Please Enter ID" font-size="Large" font-names="Verdana"
                        font-italic="true"></asp:label>
                </td>
                <td>
                    <asp:textbox id="TextBox4" runat="server"></asp:textbox>
                </td>
            </tr>
            <tr>
                <td>
                    <asp:label id="Label2" runat="server" text="Please Enter FirstName" font-size="Large"
                        font-names="Verdana" font-italic="true"></asp:label>
                </td>
                <td>
                    <asp:textbox id="TextBox1" runat="server"></asp:textbox>
                </td>
            </tr>
            <tr>
                <td>
                    <asp:label id="Label3" runat="server" text="Please Enter LastName" font-size="Large"
                        font-names="Verdana" font-italic="true"></asp:label>
                </td>
                <td>
                    <asp:textbox id="TextBox2" runat="server"></asp:textbox>
                </td>
            </tr>
            <tr>
                <td>
                    <asp:label id="Label4" runat="server" text="Please Enter Age" font-size="Large"font-names="Verdana"
                        font-italic="true"></asp:label>
                </td>
                <td>
                    <asp:textbox id="TextBox3" runat="server"></asp:textbox>
                </td>
            </tr>
            <tr>
                <td colspan="2">
                    <asp:button id="Button1" runat="server" text="Update Data" font-names="Verdana"width="166px"
                        backcolor="Orange" font-bold="True" onclick="Button1_Click" />
                </td>
            </tr>
            <tr>
                <td colspan="2">
                    <asp:label id="Label5" runat="server" font-bold="true" font-names="Verdana"forecolor="Maroon"></asp:label>
                </td>
            </tr>
        </table>
    </center>
</div>

Step 7: The complete code of visualwebpart1usercontrol.ascx.cs looks like this:

using System;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using Microsoft.SharePoint;
namespace ListUpdateApplication.UpdateListWebPart
{
    public partial class UpdateListWebPartUserControl : UserControl
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            TextBox4.Focus();
        }
        protected void Button1_Click(object sender, EventArgs e)
        {
            if (string.IsNullOrEmpty(TextBox4.Text))
            {
                Label5.Text = "Please Enter Some Values";
            }
            else
            {
                SPSite site = SPContext.Current.Site;
                SPWeb web = site.OpenWeb();
                web.AllowUnsafeUpdates = true;
                SPList list = web.Lists["Student"];
                SPListItem item = list.GetItemById(Convert.ToInt32(TextBox4.Text));
                item["First Name"] = TextBox1.Text;
                item["Last Name"] = TextBox2.Text;
                item["Age"] = Convert.ToInt32(TextBox3.Text); item.Update();
                Label5.Text = "Data Successfully Updated";
                TextBox1.Text = string.Empty;
                TextBox2.Text = string.Empty;
                TextBox3.Text = string.Empty;
                TextBox4.Text = string.Empty;
            }
        }
    }
}

Step 8: Deploy the solution file and add the created webpart to the SharePoint site:

Step 9: The output of the application looks like this:


Step 10: When updating the list the output of the application looks like this: