Thursday, 28 November 2013

Sharepoint 2010 Search configuration

In this article I am describing how to configure Search in SharePoint 2010.

1. Go to SharePoint Central Administration.

2. Click on Application management then select Manage Service application.
 
ConSerShare1.gif

3. Click New and select Search Service Application
 
ConSerShare2.gif

4. Give a name for your Service application.

5. Select Search Service account or register new Service account in the drop down.

6. Better create a new application pool for your Search service as shown below.
 
ConSerShare3.gif

7. Once done Click OK.
 
ConSerShare4.gif

8. It will take some time to configure the service.

9. Once configured correctly you will see the service created like below.
 
ConSerShare4.1.gif

10. Click on the Search Service Application 1 that we create now.

11. Select Content Source. 

ConSerShare5.gif

12. Click on the Local SharePoint Site.
 
ConSerShare6.gif

13. Add the Web applications that you need to put in Search Services as shown below.
 
ConSerShare7.gif

14. You have to configure Full and incremental crawl schedules in the preceding screen.

15. Now go back and start a Full crawl.
 
ConSerShare8.gif

16. You will get the following screen.
 
ConSerShare9.gif

17. Even though you have done all these steps you may get some error while searching "The search request was unable to connect to the Search Service".

18. To avoid this you have to perform the following steps.

19. Go to Application management and select Configure Application Association as shown below.
 
ConSerShare10.gif

20. Click on your application.

21. From the "Edit the following group of connections" drop down select Custom.

22. Associate your search service with your web application.

ConSerShare11.gif

23. If you done this step you may have to start the crawl once again.
 

Thursday, 24 October 2013

Creating UserToken in Sharepoint

SPUserToken userToken = SPContext.Current.Web.AllUsers["domain name\\UserLoginId"].UserToken;
                using (SPSite site = new SPSite(SPContext.Current.Site.ID, userToken))
                {
                    SPWeb myweb = site.OpenWeb();
                    Guid docsid=new Guid(hiddenDocumentLibraryName.Value);
                    SPDocumentLibrary myDocLib = (SPDocumentLibrary)myweb.Lists[docsid];
                    SPListItem items=                                               myDocLib.Items.GetItemById(Convert.ToInt32(hiddenDocumentId.Value));
                    myweb.AllowUnsafeUpdates = true;
                    items.File.CheckOut();
                 
                }

Monday, 23 September 2013

Passing filter values on the URL to PerformancePoint Services web parts

Although this pattern’s as old as the web, you asked us to make PerformancePoint dashboards work with it. In SharePoint 2010 it works!
The steps are the same whether you deploy a page that uses only PerformancePoint web parts using Dashboard Designer, or build a more complex page using SharePoint web or SharePoint Designer.
  1. Understand how Query String (URL) Filter works
  2. Build the content & page
  3. Add Query String (URL) Filter web parts for each attribute you want to control on the URL
  4. Connect each filter web part to the web parts you want it to affect
To illustrate we’ll add URL filtering to a simple dashboard that has one PerformancePoint Report web part.
We will specify Geography on the URL:

2

1. Understand how Query String (URL) Filter works

The Query String (URL) Filter accepts the name and value parts, separated by an equals sign, and multiple filters separated by a semi-colon (this is quite common and not unique to SharePoint.)
3
You’ll have full control over the name part. We’ll explain how to specify it in the next step.
The value depends on the web part the value’s passed to. In the case of PerformancePoint Services web parts you’ll need a member unique name for the data source(s) referenced by the content.
Unfortunately a Query String (URL) filter and another filter can’t be synchronized with the same consumer field of a web part. Although you can connect more than one filter web parts to the same consumer field, this won’t result in the multiple filters being synchronized with the field. You will have to choose one mode or the other.

2. Build the content & page

We laid out the analytic chart “Local Sales Report” in Dashboard Designer. The only detail of interest is we put the Geography hierarchy in the Background well so we can connect filters to it in SharePoint.
If you’re going to do URL filtering we recommend you do your page editing outside Dashboard Designer. Dashboard Designer’s web part page deployment is very simplistic and removes all changes not possible within Dashboard Designer, including URL filtering.
For this example we didn’t use Dashboard Designer at all except to create “Local Sales Report.” We started with a blank web part page, added the PerformancePoint Report web part, then configured it to show “Local Sales Report.”

3. Add Query String (URL) Filter web parts for each attribute you want to control on the URL

For each query string parameter you want the page to have:
  1. In SharePoint web put the page in edit mode (Select the Page tab in the ribbon, and click Edit Page.)
  2. Click Add a Web Part in any zone.
  3. In the Categories column, select Filters
  4. Select Query String (URL) Filter and click Add 4
  5. In the new web part’s web part menu, click Edit Web Part:

     5
  6. In the tool pane fill out Query String Parameter Name. You may also want to fill out Default Value, so that when the parameter’s not specified a reasonable default’s used.

     6
  7. Click “OK at the bottom of the tool pane.

4. Connect each filter web part to the web parts you want it to affect

For each web part you want the filter to affect:
  1. From the web part menu on the filter web part select: Connections -> Send Filter Values To –> then the destination web part:
    7
  2. The Choose Connection dialog appears. You’ll have 2 choices for Connection Type; either will work in this case.
  3. Under Configure Connection select the field you’d like to filter. The options vary based on the web part, and in the case of PerformancePoint web parts, on the content. Here we select the Geography hierarchy we added to “Background” in Local Sales Report:
    8
  4. Click Finish.
  5. You can now click “Stop Editing”, and try it out:
9
 

Wednesday, 3 July 2013

Hide Quick Launch using Javascript

Add bellow script in page

<style>

#s4-leftpanel {
DISPLAY: none
}
.s4-ca {
MARGIN-LEFT: 0px
}</style>

Thursday, 16 May 2013

Backup/Restore of SharePoint 2010 site Collection using Power Shell

In this article I am showing you how to perform backup/restore operation using Power Shell 

1. On the Start menu, click All Programs.
2. Click Microsoft SharePoint 2010 Products.
3. Click SharePoint 2010 Management Shell.
4. At the Windows Power Shell command prompt type the following command:
Image1.gif

5. You will get a Power shell command prompt like below
Image2.gif

6. In SharePoint 2010, Power Shell command Backup-SPSite is used for taking backup

7. Please see the screen shot for the backup Power Shell command

8. Backup-SPSite -Identity http://ServerName:port -Path "c:\backup\file.bak"

 Image3.gif

9. If you want to overwrite a previously used backup file, use the Force parameter. You can use the NoSiteLock parameter to keep the read-only lock from being set on the site collection while it is being backed up. However, using this parameter can allow users to change the site collection while it is being backed up and might lead to possible data corruption during backup. 

10. Once this done you will get the backup.

11. Next you have to create site collection then use the below command to restore the backup that we currently taken.

12. Restore-SPSite -Identity http://Servername:port -Path "c:\backup\file.bak" -force

Image4.gif

13. I am using force command because I want to overwrite the existing site collection that I created now.