How to force a full Reindex in SharePoint with PowerShell


In SharePoint , you may want to trigger a complete re-indexing of your site. This manipulation is possible with the site administration.



You can do the same thing with PowerShell by changing the value of the web property vti_searchversion

Below is a PowerShell function that re-index the entire site collection, it will update the vti_searchversion value, which will trigger a complete site collection re- indexing that will be considered in the next crawling.

function ReindexSite{
      param($web)

      Write-Host -ForegroundColor Yellow " Reindexing Site : " $ web.Title
      [int] $version = 0
      $propertyBag = $ web.AllProperties
      if ($propertyBag.ContainsKey("vti_searchversion") -eq $true)
      {
            $version = $propertyBag["vti_searchversion"]
      }
      Write-Host "Current search version: " $version -ForegroundColor Yellow
      $version++
      $propertyBag ["vti_searchversion"] = $version
      Write-Host "Updated search version: " $version -ForegroundColor Green
      $web.Update()
      foreach ($subWeb in $ web.Webs)
      {
            ReindexSite($subWeb)
      }
}

You can do also the same thing in SharePoint Online with this script:



function ReindexSite{
       param($web)

       $subWebs = $web.Webs
       $clientContext.Load($web)
       $propertyBag = $ web.AllProperties
       $allProperties = $web.AllProperties
       $clientContext.Load($propertyBag)
       $clientContext.Load($subWebs)
       $clientContext.ExecuteQuery()

       Write-Host -ForegroundColor Yellow " Reindexing Site : " $ web.Title
       [int] $version = 0
       $propertyBag = $ rootWeb.AllProperties
       if ($propertyBag.FieldValues.ContainsKey("vti_searchversion") -eq $true)
       {
             $version = $propertyBag["vti_searchversion"]
       }
       Write-Host "Current search version: " $version -ForegroundColor Yellow
       $version++
       $propertyBag["vti_searchversion"] = $version
       Write-Host "Updated search version: " $version -ForegroundColor Green
       $web.Update()
$clientContext.ExecuteQuery()
       foreach ($subWeb in $subWebs)
       {
             ReindexSite($subWeb)
       }
}

Announcing availability of SharePoint Server 2016 IT Preview and cloud hybrid search

You can find the link here to the announcing of SharePoint Server 2016 :

https://blogs.office.com/2015/08/24/announcing-availability-of-sharepoint-server-2016-it-preview-and-cloud-hybrid-search/#.VdtKWsd2nNs.facebook




You can download SharePoint Server 2016 IT Preview and try it.



Learn more about SharePoint Server 2016 IT Preview and see many of these updates in actions on this week's Office Mechanics show:




Disable “Add, Edit and Delete Web Parts” within a Web Part Zone

Recently, I have been working with page layouts and I wanted to ensure webparts are added to the web part zone only programmatically.  I wanted end users are not able to add, edit or remove webparts from  Web Part Zone.

I have find some web part zone properties like  “AllowLayoutChange” property which can be used to ensure “Add a Web Part”  is hidden while page is in edit mode.

<div>
                <WebPartPages:WebPartZone runat=”server” AllowLayoutChange=”false”AllowPersonalization=”false”
               FrameType=”TitleBarOnly” ID=”MainZone” Title=”Main Zone” Orientation=”Vertical”>
                <ZoneTemplate></ZoneTemplate>
                </WebPartPages:WebPartZone>
</div>



OWSTIMER keeps old copy of an assembly so new Feature Reciver code not picked up on deploy


When you install/uninstall a Feature that has a FeatureReceiver OWSTIMER keeps a handle open on the dll containing the feature receiver until its restared
This means that when you uninstall the feature Fusion will move the dll to the c:\windows\temp\ directory and still keep the reference.
When you then try and install the new version, OWSTIMER will run the OLD feature receiver, meaning that your new code, the stuff you've just installed, doesn't fire.


You can stop this occurring with a restart of the OWSTIMER service «SharePoint 2010 Timer», and now the OWSTIMER will run the new feature receiver.

Show webpart in master page - Sharepoint 2010



Displaying a webpart (your own custom made or any of the OOTB ones) in the master page of your site might not be directly supported by the GUI, but it requires minimal effort and no coding.
The easiest way that I found is to add the web part to a normal page (not within a zone), open this page in Sharepoint Designer and copy the generated code. This code can then be inserted into the masterpage where you want it displayed, and then finally add the tag prefix in the header of the masterpage to reference the webpart assembly.
Here’s an example:
The following code is the generated markup for my SP_Tests_WP WebPart.

<WpNs0:SP_Tests_WP runat="server" ID="g_e932ec34_a94e_4ae4_88e7_bc8df28db334" Description="Mon composant Visual WebPart" Title="SP_Tests_WP" ImportErrorMessage="Impossible d’importer ce composant WebPart." __MarkupType="vsattributemarkup" __WebPartId="{E932EC34-A94E-4AE4-88E7-BC8DF28DB334}" WebPart="true" __designer:IsClosed="false" partorder="2"></WpNs0:SP_Tests_WP>



Take note of the « WpNso » prefix, this is the one that references to the webpart assembly. You will find the reference at the top of the page, looking a little something like this:


<%@ Register Tagprefix=" WpNs0" Namespace="SharePointProject_Test. SP_Tests_WP " Assembly=" SharePointProject_Test, Version=14.0.0.0, Culture=neutral, PublicKeyToken= 7a77e7fcb2276b4c" %>

Just copy the same tag prefix to the masterpage and you’re done!





5 SharePoint 2010 Web Parts You Should Get to Know

One of the fundamental components of a SharePoint site is a Web Part. Web Parts are "gadgets" that can be added to a page to perform a specific function. Although you may purchase or develop your own Web Parts to meet a specific need in your organization, SharePoint provides many Web Parts out of the box. In this article, I explore some of the built in Web Parts that you should get to know.



InfoPath Form Web Part
The InfoPath Form Web Part is brand new to SharePoint 2010. It is available only in the Enterprise edition of SharePoint 2010. What the Web Part allows you to do is to customize the default forms for a SharePoint list. When you create a list in SharePoint, three pages are created for you automatically: DispForm.aspx, EditForm.aspx, and NewForm.aspx. As the names suggest, these forms are used to display items, edit items and add items to a SharePoint list. If you want to use InfoPath 2010 to customize the default pages for a list rather than using SharePoint Designer 2010, all you need to do is click the InfoPath icon on the List tab of the Web page. InfoPath will open on your desktop and you can customize the form for the SharePoint list the same way that you customize an InfoPath Forms Library form. You can add images, insert tables, move fields, add validation rules, and include functions all through an easy to understand interface. One thing that you cannot do is add .NET managed code to the form, but this is a great way for power users to make a form look and function the way they need it to without writing program code.



Content Query Web Part
The Content Query Web Part is available for pages on sites in which the publishing infrastructure feature has been activated. Probably the most common use of the Web Part is to roll up information from multiple lists into a single view. You can apply filters and styles to make the content look the way you want. Imagine you have a publishing page that displays a certain article and you want to display a list of related stories next to it on the page. Using the Content Query Web Part, you can search all the lists on the site that use the same keywords as the keywords for the featured article, and display them in a list.



XSLT List View Web Part
You create an XSLT List View Web Part in SharePoint Designer 2010. The benefit of an XSLT List View Web Part is that it allows you to customize the out of the box list views. You can rearrange fields, hide them, or apply special formatting. Much of the customization can be done in the design view, but if you want to use special functions you can convert the entire view to XSL and manipulate the XSL code directly.



Chart Web Part
The Chart Web Part is also new to SharePoint 2010. It is included in the Enterprise edition of the server. The Chart Web Part allows you to build charts or graphs easily through a wizard interface – pulling data from a variety of sources. Power users are able to use it to create graphical dashboards from SharePoint lists with no knowledge of programming. Creating a chart in SharePoint with the Chart Web Part is as simple as creating a chart in Excel.



Content Editor Web Part
The Content Editor Web Part has been included in SharePoint for multiple releases. It was originally designed to be a content placeholder for text, rich text or embedded HTML on a SharePoint page. Functionality has been added to allow the Content Editor Web Part to pull in content from text files or rich text format files. A popular use for the Content Editor Web Part now is to use JavaScript (often jQuery) to customize the look and functionality of a SharePoint page. You can manipulate the style of a page, or you may perform transactions using the SharePoint REST Web Services. This has been an ideal customization approach for web designers and developers who do not have .NET development skills, and for others who use SharePoint in a hosted environment where managed code is not allowed.


                

SharePoint 2010 Web Parts and Their Features

Below is a list of all of the “out of the box” web parts that comes with SharePoint 2010. The column on the right highlights which Site Collection Feature you have to activate to enable the web parts. Some web parts will require additional farm solutions like SQL Reporting.
Business Data

Business Data Actions – Displays a list of actions from Business Data Connectivity.
SharePoint Server Enterprise Site Collection features
Business Data Connectivity Filter – Filters the contents of Web Parts using a list of values from the Business Data Connectivity.
SharePoint Server Enterprise Site Collection features
Business Data Item – Displays one item from a data source in Business Data Connectivity.
SharePoint Server Enterprise Site Collection features
Business Data Item Builder – Creates a Business Data item from parameters in the query string and provides it to other Web Parts.
SharePoint Server Enterprise Site Collection features
Business Data List – Displays a list of items from a data source in Business Data Connectivity.
SharePoint Server Enterprise Site Collection features
Business Data Related List – Displays a list of items related to one or more parent items from a data source in Business Data Connectivity.
SharePoint Server Enterprise Site Collection features
Chart Web Part – Helps you to visualize your data using charts, pull data from another web part, SharePoint lists, Business Data Catalog, or Excel Services.
SharePoint Server Enterprise Site Collection features
Excel Web Access – Use the Excel Web Access Web Part to interact with an Excel workbook as a Web page.
SharePoint Server Enterprise Site Collection features
Indicator Details – Displays the details of a single Status Indicator. Status Indicators display an important measure for an organization and may be obtained from other data sources including SharePoint lists, Excel workbooks, and SQL Server 2005 Analysis Services KPIs.
SharePoint Server Enterprise Site Collection features
Status Lists – Shows a list of Status Indicators. Status Indicators display important measures for your organization, and show how your organization is performing with respect to your goals.
SharePoint Server Enterprise Site Collection features
Visio Web Access – Enables viewing and refreshing of Visio Web Drawings, like org charts, workflows, business processes and more.
SharePoint Server Enterprise Site Collection features

Content Rollup

Categories – Displays categories from the Site Directory, discontinued in SharePoint 2010, available for SharePoint 2007 upgrades.
SharePoint Server Standard Site Collection features
Content Query – Rolls up data from sub sites throughout your site. Data can be queried and filtered based on content type, site columns, and specific lists and libraries.
SharePoint Server Publishing Infrastructure
Relevant Documents – Displays documents that have been modified by, created by, or checked out to the current user, within the current web site (not the entire site collection).
Fresh Install
RSS Viewer – Displays an RSS feed from other websites or services.
SharePoint Server Standard Site Collection features
Site Aggregator – Displays specific information from the sites of your choice, defaults to showing documents similar to Relevant Documents.
SharePoint Server Standard Site Collection features
Sites In Category – Displays sites from the Site Directory within a specific category, discontinued in SharePoint 2010, available for SharePoint 2007 upgrades.
SharePoint Server Standard Site Collection features
Summary Links – Allows authors to create a custom link library that can be grouped and styled.
SharePoint Server Publishing Infrastructure
Table Of Contents – Displays the navigation hierarchy of your site, subsites, lists and libraries.
SharePoint Server Publishing Infrastructure
Web Analytics Web Part – Displays the most viewed content, most frequent search queries from a site, or most frequent search queries from a search center.
Advanced Web Analytics
WSRP Viewer – Displays portlets from web sites using WSRP 1.1.
SharePoint Server Enterprise Site Collection features
XML Viewer – Transforms XML data using XSL and shows the results.
Fresh Install

Filters

Apply Filters Button – Add this button to a page so users can decide when to apply their filter choices. Otherwise, each filter is applied when its value is changed.
SharePoint Server Enterprise Site Collection features
Choice Filter – Filters the contents of Web Parts using a list of values entered by the page author
SharePoint Server Enterprise Site Collection features
Current User Filter – Filters the contents of Web Parts by using properties of the current user
SharePoint Server Enterprise Site Collection features
Date Filter – Filter the contents of Web Parts by allowing users to enter or pick a date
SharePoint Server Enterprise Site Collection features
Page Field Filter – Filters the contents of Web Parts using information about the current page
SharePoint Server Enterprise Site Collection features
Query String (URL) Filter – Filters the contents of Web Parts using values passed via the query string
SharePoint Server Enterprise Site Collection features
SharePoint List Filter – Filters the contents of Web Parts by using a list of values
SharePoint Server Enterprise Site Collection features
SQL Server Analysis Services Filter – Filters the contents of Web Parts using a list of values from SQL Server Analysis Services cubes
SharePoint Server Enterprise Site Collection features
Text Filter – Filters the contents of Web Parts by allowing users to enter a text value
SharePoint Server Enterprise Site Collection features

Forms

HTML Form Web Part – Connects simple form controls to other Web Parts
Fresh Install
InfoPath Form Web Part – Use this Web Part to display an InfoPath browser-enabled form
SharePoint Server Enterprise Site Collection features

Media and Content

Content Editor – Allows authors to enter rich media content like formatted text, images, and other custom HTML.
Fresh Install
Image Viewer – Displays a specified image.
Fresh Install
Media Web Part – Use to embed media clips (video and audio) in a web page, links directly to a video file, not a video service like YouTube.com.
SharePoint Server Publishing Infrastructure
Page Viewer – Displays another Web page on this Web page inside of a window.
Fresh Install
Picture Library Slideshow Web Part – Use to display a slideshow of images and photos from a picture library
Fresh Install
Silverlight Web Part – A web part to display a Silverlight application
Fresh Install

Outlook Web App

My Calendar – Displays your calendar using Outlook Web Access for Microsoft Exchange Server 2003 or later
SharePoint Server Standard Site Collection features
My Contacts – Displays your contacts using Outlook Web Access for Microsoft Exchange Server 2003 or later
SharePoint Server Standard Site Collection features
My Inbox – Displays your inbox using Outlook Web Access for Microsoft Exchange Server 2003 or later
SharePoint Server Standard Site Collection features
My Mail Folder – Displays your mail folder using Outlook Web Access for Microsoft Exchange Server 2000
SharePoint Server Standard Site Collection features
My Tasks – Displays your tasks using Outlook Web Access for Microsoft Exchange Server 2003 or later
SharePoint Server Standard Site Collection features

PerformancePoint

PerformancePoint Filter – This web part displays PerformancePoint filters. Filters may be linked to other web parts to provide an interactive dashboard experience. Filter types include lists and trees based on a variety of data sources
PerformancePoint Services Site Collection Features
PerformancePoint Report – This web part displays PerformancePoint reports. Reports may be linked to other web parts to create an interactive dashboard experience. Report types include: Analytic charts & grids, Strategy Maps, Excel Services, Reporting Services, Predictive Trend charts, and web pages
PerformancePoint Services Site Collection Features
PerformancePoint Scorecard – This web part displays a PerformancePoint scorecard. Scorecards may be linked to other web parts, such as filters and reports, to create an interactive dashboard experience.
PerformancePoint Services Site Collection Features
PerformancePoint Stack Selector – This web part displays a PerformancePoint Stack Selector. All PerformancePoint web parts, such as filters and reports, contained in the same zone will be automatically stacked and selectable using this web part.
PerformancePoint Services Site Collection Features

Search

Advanced Search Box – Displays parameterized search options based on properties and combinations of words.
SharePoint Server Standard Site Collection features
Dual Chinese Search – Used to search Dual Chinese document and items at the same time.
SharePoint Server Standard Site Collection features
Federated Results – Displays search results from a configured location
SharePoint Server Standard Site Collection features
People Refinement Panel – This webpart helps the users to refine people search results
SharePoint Server Standard Site Collection features
People Search Box – Presents a search box that allows users to search for people
SharePoint Server Standard Site Collection features
People Search Core Results – Displays the people search results and the properties associated with them.
SharePoint Server Standard Site Collection features
Refinement Panel – This webpart helps the users to refine search results
SharePoint Server Standard Site Collection features
Related Queries – This webpart displays related queries to a user query
SharePoint Server Standard Site Collection features
Search Action Link – Displays the search action links on the search results page
SharePoint Server Standard Site Collection features
Search Best Bets – Displays high-confidence results on a search results page.
SharePoint Server Standard Site Collection features
Search Box – Displays a search box that allows users to search for information.
SharePoint Server Standard Site Collection features
Search Core Results – Displays the search results and the properties associated with them
SharePoint Server Standard Site Collection features
Search Paging – Display links for navigating pages containing search results.
SharePoint Server Standard Site Collection features
Search Statistics – Displays the search statistics such as the number of results shown on the current page, total number of results and time taken to perform the search.
SharePoint Server Standard Site Collection features
Search Summary – Displays suggestions for current search query
SharePoint Server Standard Site Collection features
Search Visual Best Bet – Displays Visual Best Bet
SharePoint Server Standard Site Collection features
Top Federated Results – Displays the Top Federated result from the configured location
SharePoint Server Standard Site Collection features

Social Collaboration

Contact Details – Displays details and image for a single contact.
SharePoint Server Standard Site Collection features
Note Board – Enable users to leave short, publicly-viewable notes about this page.
SharePoint Server Standard Site Collection features
Organization Browser – This Web Part displays each person in the reporting chain in an interactive view optimized for browsing organization charts. Additional information has to be managed in Active Directory.
SharePoint Server Standard Site Collection features
Site Users – Use the Site Users Web Part to see a list of users and groups who have access to the current site, or list users from a selected group.
Fresh Install
Tag Cloud – Displays the most popular subjects being tagged inside your organization
SharePoint Server Standard Site Collection features
User Tasks – Displays tasks that are assigned to the current user within the site, does not include all tasks in site collection.
Fresh Install

SQL Server Reporting

SQL Server Reporting Services Report Viewer – Use the Report Viewer to view SQL Server Reporting Services reports.
Report Server Integration Feature