Monday, 19 June 2017

Caml Query to filter people and group column with current user

Use below caml query to get records for current user by filtering People and Group column.

<Where><Eq><FieldRef Name='ColumnInternalName' /><Value Type='Integer'><UserID Type='Integer'/></Value></Eq></Where>

Hope this helps!!!!

Powershell to get display name and internal name of SharePoint list columns

Below is the Powershell script to get column information from SharePoint list to .csv file.

$url = "Your SharePoint Site URL"
$listName = "List Name"
$path ="c:\Columns.csv"

$web = Get-SPWeb $url
$list = $web.Lists.TryGetList($listName)
$list.Fields | select Title, InternalName |  Export-Csv -path $path

Hope this helps!!!!

Tuesday, 6 June 2017

SharePoint 2013 Search Stopped Working

All of sudden one day our search started to throw error for "Something went wrong", the ULS logs were showing below error:
The processing of item fails with error Cannot plan query for index system SP6bd7dedd292c. Index fragment '0' has no available cells.
Basically it appears the search index partition becomes corrupted.

Following steps resolved the issue:
  1. Stop the Timer Service
  2. Clear the configuration cache - Find in %SystemDrive%\ProgramData\Microsoft\SharePoint\Config\ the folder where the file cache.ini exists
  3. Delete every file from this folder EXCEPT cache.ini
  4. Open cache.ini, delete the content and put '1' (without the quotes) in it and save the file.
  5. Restart the Timer Service.
  6. Reset the Index
  7. Perform Full crawl
Hope this helps!!!

Ref: https://sharepoint.stackexchange.com/questions/114273/sharepoint-2013-search-not-working-ootb

Saturday, 3 June 2017

How to get count of document libraries in a SharePoint site using SSOM?

To get the count of document libraries, we can use below simple code in SSOM:

using(SPSite site = new SPSite("https://yoursiteURL"))
{
  using (SPWeb web = site.OpenWeb())
  {
    SPListCollection librarycollection = Web.GetListsOfType(SPBaseType.DocumentLibrary);
    int count  = librarycollection .Count;
  }
}

Sweet and Simple. Hope this helps.!!!

Friday, 2 June 2017

Is free version available in SharePoint 2016

Until SharePoint 2013, there was a SharePoint foundation version available, which is free. Unfortunately in SharePoint 2016 it is deprecated.

What's deprecated or removed from SharePoint Server 2016

But still if you want to try out SharePoint 2016, you can use SharePoint 2016 trial .

You can use one of the following trial product keys. The trial period is 180 days.
  • Enterprise trial product key: NQGJR-63HC8-XCRQH-MYVCH-3J3QR
  • Standard trial product key: RTNGH-MQRV6-M3BWQ-DB748-VH7DM
Please note
  1. You can not extend trial period for SharePoint
  2. You can convert to a licensed installation at any time during the trial or after the trial has expired by entering the appropriate product key in Central Administration.
  3. If your company have MSDN subscription, you will able to use SharePoint free for development purpose, but you can't use it in Production environment.
Hope this helps!!!
Related Posts Plugin for WordPress, Blogger...