Tuesday, 28 January 2014

SharePoint 2010 : The search function does not seem to work in some cases.

Hi all,

Today, I decided to figure out with a recurrent problem with the Search engine.
Search engine, is the standard version of SharePoint 2010 (not the enterprise version).

And, customers are always complaining about it, saying that it’s not always working.
After checking, testing and log-reading, the only visible thing is : search is working O_°

So, today, I made long tests and reproduce the problem, and give a credible explanation to my customer.

The problem is that the customer is trying to search as in Google, with part of the name.
What is wrong?
It should give back some results, but there is only the “no results found” page sent back to him.


So, I discover that the search engine will only search for the exact word in the path of the file, but it’ll give a result only if the keyword is not part of a word in the file name.

In my example, the customer is trying to have results for “VE11”.
There is no word “VE11” in the library.
But there is “VE 11” in the library, and the search is using them as 2 keywords: “VE” & “11”, and search for each of them.



Input from my customer:
Keyword(s) : SharePoint 2010 : Contoso Internal
Make your selection : Probleem
Describe : The search function does not seem to work in some cases.
Een voorbeeld uit de library “CCJ requests invoiced” op batch datum 11/12/2013:
Example: If we search on “VE 11” as part of a file name from the "CCJ requests invoiced" library, we get no result. If we search on another part of that same file name e.g. “345340” we do find a result. Idem for a search on “TU60” without result, whereas “345225” from the same name, does give a result.
Attachment : Ja

My research and conclusion:
Checked search.
Result found with all given examples.
Test with: "VE 11" and "345340"
VE 11 => several results
               

345340 => 1 result
               

VE11 => no results

VE11L3005493 => 1 result : VE11L3005493 13 ccj 345340.msg

Try to search with this word “ve11l3005493”, starting with first letter, then adding eachletter one by one.
You’ll find out how the search engine of SharePoint 2010 is working.
The search is indexing complete part of the names of the file name, not part of the different names making the filemane.
The matching result is always written in bold.
This is the reason why there is no result for "VE11", but you gor result for "345340", and also results for "VE 11" (as "VE" and "11" are indexed by the SharePoint search engine.



Then, I decided to make a last test : writing the keyword between asterisk  è *VE11*
Et voilà.







That’s all Folks


Monday, 27 January 2014

How to Limit the Self-Service Site Creation in SharePoint 2013 to only users added into a specific AD Group

Hi all,

Today, I was asked to allow the self-service site creation for the mySite in my SharePoint 2013 Farm.
As the audience will be only for the test users, I've decided to do in the same way as I've done for my SharePoint 2010 Farm.

1-      Creation of a new AD Group.
          


2-      Set the Self-Service Site Creation to "ON":
          In Central Administration, highlight the mySite Web App
          


          Select the MYSITE Web App, then review all 5 sections:
-          Self-Service Site Creation
-          User Permissions
-          User Policy
-          Anonymous Policy
-          Permission Policy


               

o   Self-Service Site Creation:
              

o   User Permissions: check this in the "Site Permissions" section
         

o   User Policy: use the default values

o   Anonymous Policy: use the default values

o   Permission Policy: use the default values




3-      Configuration of the User Profile Service Application:

In Central Administration, select the "Manage Service Applications" link:

In the "Service Applications" page, select the "User Profile Service Application":



            Now, select "Manage User Permissions" from the "People" section:
              
           From this Window, I've added my AD Group (in blue):

                


The settings for my AD Group is : thus, only users present in this AD Group will be able to create on demand their mySite when entering their mySite URL : http://mySite-uat.xxx.net
               

Do not forget to uncheck the "Create Personal Site" entry to all other groups, otherwise everybody from the organisation will be able to create his mySite.
               





That's all folks



MissingWebPart Error in SharePoint 2010

Hi all,

Today I found useful cmdlets to diagnose and clear those errors in the Content DB of my SharePoint 2010 Farm.

How to proceed:

Step 1: Inspect the DB
-          Test-SPContentDatabase -name <ContentDB_Name> -webapplication <Web App URL>

Step 2:
-          Select the WebPart Class GUID

Step 3:
           -     Create the SQL Function and execute it into PowerShell:

function Run-SQLQuery ($SqlServer, $SqlDatabase, $SqlQuery)
{
    $SqlConnection = New-Object System.Data.SqlClient.SqlConnection
    $SqlConnection.ConnectionString = "Server =" + $SqlServer + "; Database =" + $SqlDatabase + "; Integrated Security = True"
    $SqlCmd = New-Object System.Data.SqlClient.SqlCommand
    $SqlCmd.CommandText = $SqlQuery
    $SqlCmd.Connection = $SqlConnection
    $SqlAdapter = New-Object System.Data.SqlClient.SqlDataAdapter
    $SqlAdapter.SelectCommand = $SqlCmd
    $DataSet = New-Object System.Data.DataSet
    $SqlAdapter.Fill($DataSet)
    $SqlConnection.Close()
    $DataSet.Tables[0]
}

-          Run this command with the related WebPart Class GUID:

Run-SQLQuery -SqlServer "SRV_DATABASE" -SqlDatabase "SharePoint_Content_sharepointWorkgroup17" -SqlQuery "SELECT * from AllDocs inner join AllWebParts on AllDocs.Id = AllWebParts.tp_PageUrlID where AllWebParts.tp_WebPartTypeID = '9812863c-ee62-dab6-57f5-79e9d4d36022'" | select Id, SiteId, DirName, LeafName, WebId, ListId, tp_ZoneID, tp_DisplayName | Format-List


Step 4:
-          The result will give the below info, with the URL where the Missing Web Part is located:

Id                         : a5da7b36-083f-4d07-b50b-8f1fc8d7bbe9
SiteId                   : 53061278-8b1d-4d6d-9dce-8568f90c5574
DirName              : Sites/WW12000012/Sandbox/TestWSServiceLevelDashboard
LeafName            : default.aspx
WebId                 : 2ab691b1-0d74-4bf2-9524-c6b1d969cfac
ListId                   :
tp_ZoneID           : Left
tp_DisplayName  :



                  Adding at the end of the URL "?contents=1" will let SharePoint to show the "Web Part Page"


-          So, here are the steps that I follow to remove the “ErrorWebPart”:

1- select the Error rows
2- click on “Close” to set them as “No” for the “Open on Page?” column
3- select the same Error rows then Delete them



Step 5:
-          Execute again the “Test-SPContentDatabase” to check that all entries for the MissingWebPart are gone.




That's all folks




How to replace an existing URL located in the Top Navigation Bar

Hi All,

Today's request is to replace the Hyperlink in the navigator bar, as the referenced site URL has changed.




And last but not least, the request is to change this hyperlink to all sites inside the Web App: more than 1800 Site Collection.


This is the used Code:

#----------------------------------------------------------------------
#Below the code to update the topnavigationbar
#  for all Site Collection of the mentioned Web Application .
# Author : Marc Mathot
# Date: November 2013
#----------------------------------------------------------------------
$Webs = Get-SPSite -WebApplication "http://SharePoint.Contoso.com"  -limit ALL | Get-SPWeb -limit all

Foreach($Web in $Webs)
{
$TN = $Web.Navigation.TopNavigationBar | Where-Object {$_.Title -eq "Landing Page & Wiki"}
if ($TN.url -like "http://SharePoint.Contoso.com*")
{
   write-host "Updating $($Web.url)"
  “Updating $($Web.url), $($TN.Url)” | out-file D:\temp\LandingPageUpdate.csv   -append
    $TN.Url = "http://NewSharePoint.Contoso.com/Pages/LandingPageWikiDefault.aspx"
    $TN.update()
}
}
#----------------------------------------------------------------------

Also, in parallel, I had to modify the template used to create the new sites into this Web App.
Doing this will avoid having to run this script periodically to correct the changes.




That's all folks