Start Search Service Application Crawl in SharePoint 2013

lundi 25 novembre 2013
I encountred this error while trying to start a full crawl on the search service application of a SharePoint 2013 farm.


Access is denied. Verify that either the Default Content Access Account has access to this repository, or add a crawl rule to crawl this repository. If the repository being crawled is a SharePoint repository, verify that the account you are using has "Full Read" permissions on the SharePoint Web Application being crawled.

After spending a lot of time googling this, I ended up founding THE SOLUTION.
Usualy this error is related to some URLs from which the search system start crawling. You can edit these URLs from the Search Service Application / Content Souces / Start Addresses

Anyway, this how you can garantee a working crawl for your Search Service ;


1.  Check your Search Account
  • First go to you Sharepoint central admin
  • Click on "Manage service application", then "Search Service Application".
  • On this screen, you have you search account in front of "Default content access account"
  • This account will need some special roles and rights (permissions)  to get through your data

2.  Get SharePoint Web Applications being crawled
  • Click on "Manage service application", then "Search Service Application". On the left menu, click "Content Sources" from the Crawling section.
  • Here you will find at least on content source created by SharePoint for you : "Local SharePoint sites"
  • Edit this content souce, and notice all the "Start Addresses". You will need to configure every web application corresponding to these URLs.
  • Here, usualy problems came from sps3://[my-site-url]. You will see further on this ticket.

3.  Giving permissions to the Search Account
  • Central Administration > Application Management > Manage Web Application
  • Here you have all your web applications, select everyone of those, just highlighting its line, and do the following :
  • Click on "User Policy" from the ribbon
  • Click "Add Users" from the popup showing, and select your Search Account. You should give Full Read permission.

4.  What about the User Profile Application Service ?
  • Steps 1, 2 and 3 could be good enough. But what if not ?
  • Go to the UPS, the User Profile Service. Just the same way you went to the Search Service Application ? No, but almost,  from the "Manage service application", Highlight UPS and click "Administrators" from the ribbon.
  • Add your Search Account and check "Retrieve People Data for Search Crawlers". You could even check "Full Control", but the first checkbox should be sufficient.

5.  The Search Account itself
  • What you've done until now should do the trick. But what if not ? ohh ! again !
  • Get back to the Search Service Application.
  • Click on the Search Account, as I said befor, in front of "Default content access account".
  • Set the password of this account.
  • Click "OK".

Now you'll be able run your crawls whenever you want.


Nizar Joober

Programmatically create a list and a SPFieldMultiLineText with RichText

dimanche 20 octobre 2013

First, you need to create your List :

Code:
SPWeb web = //[Get your web]
SPList MyList = Utilities.CreateList(web, Title, Key, SPListTemplateType.GenericList);

Then you do the following to create the SPFieldMultiLineText


Code:
// Add RichText column
string htmlFieldName = Utilities.AddField(MyList, SPFieldType.Note, FieldName, false, true);
SPFieldMultiLineText htmlField = MyList.Fields[FieldName] as SPFieldMultiLineText;
htmlField.RichText = true;
htmlField.RichTextMode = SPRichTextMode.FullHtml;
htmlField.Update();

You can even rename the original Title column


Code:
// Rename the original Title column
SPField TitleField = MyList.Fields[SPBuiltInFieldId.Title];
TitleField.Title = anOtherName;

Finally, we run our code snippet into an event receiver


Code:
[Guid("xxx")]
public class MybEventReceiver : SPFeatureReceiver
 {
 public override void FeatureActivated(SPFeatureReceiverProperties properties)
  {
  SPWeb web = //[Get your web]
  SPList MyList = Utilities.CreateList(web, Title, Key, SPListTemplateType.GenericList);
  // Rename the original Title column
  SPField TitleField = MyList.Fields[SPBuiltInFieldId.Title];
  TitleField.Title = anOtherName;
  // Add RichText column
  string htmlFieldName = Utilities.AddField(MyList, SPFieldType.Note, FieldName, false, true);
  SPFieldMultiLineText htmlField = MyList.Fields[FieldName] as SPFieldMultiLineText;
  htmlField.RichText = true;
  htmlField.RichTextMode = SPRichTextMode.FullHtml;
  htmlField.Update();
  }
 }

Actually, this could run for SharePoint 2010 too. 

How to install SharePoint 2013 with controlled names for databases

samedi 19 octobre 2013


Are you having a similar name for your adminCentral database : SharePoint_AdminContent_[GUID] ?
If you are looking for more control, this is how you can create databases with "better" names :


  1. Launch the SharePoint 2013 Management PowerShell as an Administrator.
  2. Type this :
    Code:
    New-SPConfigurationDatabase -DatabaseName CONFIG_DB_NAME_HERE -DatabaseServer SERVER_NAME_HERE -AdministrationContentDatabaseName ADMIN_DB_NAME_HERE -FarmCredentials (Get-Credential) -Passphrase (ConvertTo-SecureString "TYPE_YOUR_PWD_HERE" -AsPlainText -Force)
    

Notice that you can use this command, only before executing the SharePoint 2013 configuration Wizard, so just after binaries been installed.

During the installation, you'll be asked to launch the wizard and continue the process. You'll have to uncheck the checkbox.

How to know whether or not you are liking SocialPost - Sharepoint 2013 Client Object API

vendredi 18 octobre 2013

Today, I'd to speek about giving users the possibility to like SharePoint 2013 posts using the Client Object API.
You'll need to instanciate your SocialFeedManager with your context, and then call the "LikePost" method with the postId you would 'like'.


Code:
public SocialThread LikeThisPost(string SharePointWebUrl, string PostId)
 { 
 SocialFeedManager feedManager = new SocialFeedManager(ctx);
 ClientResult thread = feedManager.LikePost(PostId);
 ctx.ExecuteQuery();
 return thread.Value;
 }

This method returns the whole thread, containing the root post, all the replies and many other attributes.
Maybe you'll need to parse this result into your business post object.

From the SocialPost's LikerInfo collection you could know if the current user likes the post or not.
No need to try to implement some logic for getting this, SharePoint has already done this for you.


Code:
bool CurrentUserLikesThis = socialPost.LikerInfo.IncludesCurrentUser;

My First Post

Hi everybody,

Here are my first words on this blog.
I'm Nizar Joober, I'm 27 and I'm SharePoint developer since 2011.

I'll be sharing some points on these pages, mainly SharePoint subjects, and issues that I encounter while SharePointing.

Welcome to my blog
Copyright @ 2013 Nizar Joober - I'm SharingPoints. Designed by Templateism

Top articles