SharePoint 2010 Search result Not found documents for a specific library in specific SharePoint site

Hi All,

I came across a situation where user is trying to search documents selecting the option “search in same site” instead of “all sites” from  search box and getting no result where as can find documents from other library with in same site.

Why such happens ?

The first point comes to mind for search error is  content not crawled, indexing not done for this situation.

Yes , its true but we need to think why  ?

As per my investigation I found the setting of the library as below


By default SharePoint only crawls major versions of files and draft items are only viewable by their creators. SharePoint is behaving as expected out of box.Draft items are not crawled in SharePoint

Resolution :

This behavior can be altered in Document Library Settings -> Versioning Settings -> Draft Item Security

Select the option “Any user who can read items”.

This will allow all users to see draft items including the crawling account.

  • Else you need to select “Create major versions” option or can publish the documents as major versions if want to get those documents in search result as per client wish.


Display template SharePoint Server 2013

Display templates for the Content Search Web Part

You can use the following display templates to change the appearance of content that is shown in a Content Search Web Part. These display template files are located in the Content Web Parts subfolder in the Display Templates folder in the Master Page Gallery.


Display templates for the Refinement Web Part and the Taxonomy Refinement Web Part

You can use the display templates listed in the following table to change the appearance of content that is shown in a Refinement Web Part and a Taxonomy Refinement Web Part. These display template files are located in the Filters subfolder in the Display Templates folder in the Master Page Gallery. Note that there are different display templates for different refiner types.


Display templates for the Search Results Web Part

You can use the display templates in the following table to change the appearance of content shown in a Search Results Web Part. Note that the hover panels for the different result types have separate display templates. These display template files are located in the Search subfolder in the Display Templates folder in the Master Page Gallery.


Set Maximum Number of Site Collections in SharePoint Content Database using PowerShell

For Particular Requirement, client want to dedicate a database for a single site collection. When we create a site collection from central admin, site is placed automatically in any available content database. To prevent any other sites to be created on the particular content database, We can set the maximum number of sites limit.

To set maximum number of site collections on a particular content database, navigate to:

  • Central Administration >> Application Management >> Management Content databases
  • Select our target web application in which the particular content database is attached
  • Pick the target database from the list
  • Now, in the “Manage Content Database Settings” page we can set the maximum number of sites for the content database.


Add-PSSnapin Microsoft.SharePoint.PowerShell -ErrorAction SilentlyContinue

#Variables for processing
$WebAppURL =””
$WarningSiteCount = 0

#Get all content databases of the web application
$ContentDBColl = Get-SPContentDatabase -webapplication $WebAppURL

#Iterate through each database in the web application
foreach($Database in $ContentDBColl)
#Check the current No. of sites
if($MaxSiteCount -ge $Database.CurrentSiteCount)
#Set Maximum Sites, warning level Counts
Set-SPContentDatabase -Identity $Database.Name -MaxSiteCount $MaxSiteCount -WarningSiteCount $WarningSiteCount
Write-host “Max Sites Settings updated for the database:” $ -ForegroundColor Green
write-host “MaxSiteCount must be > = current site count! No changes made in $($Database.Name)” -ForegroundColor Red

Activate site Features create APP in Site Contents SharePoint2016

Today I successfully installed SharePoint Server 2016 on-premises overcoming few errors related to prerequisite as per my previous posts.

You can see below previous posts :

  1. Windows Server Appfabric: Installation error SharePoint 2016
  2. Cannot connect to database master at SQL Server at server_name. The database might not exist, or the current user does not have permission to connect to it Error SharePoint 2016
  3. Failed to create configuration database. An exception of type Microsoft.SharePoint.Upgrade. SPUpgrade Exception was thrown. Additional exception information: One or more types failed to load. Please refer to the upgrade log for more details Error SharePoint 2016
  4. Program can’t start because api-ms-win-crt-heap-l1-1-0.dll is missing SharePoint2016
  5. Unable to install Microsoft Information Protection and control Client 2.1 error SharePoint 2016

Here I am very excited to let you know the “SharePoint APP” created in “Site Contents” by activating the “site feature“.

you may take it very easy but its not as simple as to resolve issues sometimes, that time it will help you a lot.

a. “Default APP” once site is created, before activating any feature.

Default APP in Site Contents with no feature activate

Default APP in Site Contents with no feature activate, once site is created

b. New APPs  added in Site Contents  after “Publishing Feature” is activated

New APPs added in Site Contents after

New APPs added in Site Contents after “Publishing Feature” is activated

c. New APPs  added in Site Contents  after “Content Organizer” feature is activated.

New APPs added in Site Contents after

New APPs added in Site Contents after “Content Organizer” feature is activated.

d. New APPs  added in Site Contents  after “Community Site” feature is activated.



e. New APPs  added in Site Contents  after “Site Feed” feature is activated.

New APPs added in Site Contents after

New APPs added in Site Contents after “Site Feed” feature is activated.

f. New APPs  added in Site Contents  after “Project Functionality” feature is activated.

New APP created once

New APP created once “Project Functionality” feature is activated.

amazon     amazonsp2016  amazonsp2016_2

SharePoint 2013 Default SiteCollection Templates



Save site as a template publishing site SharePoint 2013

We all know that SharePoint doesn’t support saving publishing sites as a template. I don’t recommend doing that anyway as the produced template will have errors and isn’t reliable to be used in production to create new sites off of. However, sometimes as a developer you need to save a publishing site as a template to see how SharePoint packages things. This can help you build your own custom web template which is a neat thing and replaces the need to save a publishing site as template.

Well, since the Save site as a template option is hidden from the publishing sites settings page we all used the following URL to go there directly:




Well, that is not going to work anymore in SharePoint 2013 if your site is a publishing site or have the publishing features activated.

You basically get that following error:

The “Save site as template” action is not supported on this site.


In order to get around this issue you need to update a single property page value in your SPWeb object for the site you are trying to save as a template and you are good to go. The property is called SaveSiteAsTemplateEnabled. We need to set that property to true that’s all.

I will show you how to do that using PowerShell:

# Get a reference to the target site

$web = Get-SPWeb

# Update the property bage value and set it  to the string value “true”

$web.AllProperties[“SaveSiteAsTemplateEnabled”] = “true”

# Commit the property change to server



Very simple. Now if you navigate to the Save site as a template page using the URL directly it will show fine and it will allow you to save the site as a template which stores a copy in the Solution gallery of the site collection. Make sure you have enough space in your C drive temp folder because it uses that location as a staging directory.

All Webs and Site Templates in use within a Site Collection PowerShell Script

$site = Get-SPSite “http://yoursite”

foreach ($web in $site.AllWebs) {

$web | Select-Object -Property Title,Url,WebTemplate



Unable to save site as template “unexpected error has occurred”

Here we go, it’s been a long time I didn’t publish an article which consist of hardcore troubleshooting! Yes, you are correct. It took some time to resolve but finally the issue has been resolved. This time it’s regarding problem occurring while ‘save site as template’ and how we found the culprit.

Problem description:-

User has raised the problem ticket by mentioning “facing problem while saving the site as template”, additionally the templates are getting saved in the solution gallery but not able to activate it also.

Error message:-

An unexpected error has occurred.

Troubleshoot issues with Microsoft SharePoint Foundation.

Correlation ID: acd95f50-4049-4625-9682-aa93aded118f

Troubleshooting done:-

Further debugging in the SP ULS logs and we found some strange facts which are based on event receivers- please refer below-

SPSolutionExporter: Microsoft.SharePoint.SPException: Feature definition with Id 77658379-50ff-4e1e-a431-5652bee07a87 failed validation

Looking for ‘ReceiverAssembly’ attribute in manifest root node for solution

Looking for ‘ReceiverClass’ attribute in manifest root node for solution

The ‘Format’ attribute is invalid – The value ‘CheckBoxes’ is invalid according to its datatype

I debug further to find out where the problem is-

I downloaded the saved wsp’s from  /_catalogs/solutions/Forms/AllItems.aspx to my desktop

Renamed it to .cab

Extracted all the contents and found some interesting facts along with manifest.xml file like-

List Instances


Property bags

web template

Inside List Instances, I found ElementsFields.xml

Once I opened the above xml file, search for the checkboxes and found the following-

save as template

Further exploration on this, it seems that the checkbox attribute is invalid and needs to be modified.


After this one, the solution is pretty much simple, just go ahead and remove that affected column / remove the affected content type – does not require IISRESET also.

Difference between Site page and Application page

Site Page :

  • Site pages are pages that are created, edited, and customized by end users.
  • They are primarily used for the content in a site.

  • Site pages come in two types—a standard page and a Web Parts page.

  • A standard page contains text, images, Web Parts, and other elements.

  • A Web Parts page contains Web Parts in Web Part zones. They have a predefined layout that uses Web Part zones.

  • Both types of site pages are edited using a Web browser or Microsoft SharePoint Designer.

  • Site pages are provisioned from a template page that is stored on the file system of the front-end Web server. When a site is provisioned, SharePoint Foundation creates a pointer to the instance of the page template on the file system. This allows SharePoint Foundation to avoid repeatedly creating copies of the pages, which are provisioned each time a site is created.

  • When a user customizes a site page, the template for the page is then stored in the content database. The page is retrieved from the content database every time it is requested by a user.

  • A customized page can, however, be reset to the original template page through the Web browser or a tool such as SharePoint Designer.

  • Customized site pages cannot contain in-line server code. The set of controls that are allowed to run on the page is governed by the safe controls list in the <Drive>:inetpubwwwrootwssVirtualDirectories<port number>web.config file.

  • It is a recommended best practice to avoid using server-side code on site pages when developing site definitions. If a user later edits or modifies that page, the code will no longer run.

The following are general rules for using server-side code on a site page.

  • If the page is uncustomized, server-side code is supported on the page.
  • If the page is customized, server-side code does not run, and the page does not render. This includes the code-behind for the page itself.

An administrator can add a PageParserPath setting in the web.config file that allows server-side code to run on pages stored at a specified path. This can be a single, specific page or an entire directory of pages.

Security Note

Adding PageParserPath settings gives anyone who can upload pages to the specified folders the ability to write arbitrary, full-trust code to the server. Administrators should use extreme caution when providing these settings and understand the security implications to this action.

The following sample shows a PageParserPath setting that uses a wildcard. Adding this PageParserPath will allow anyone with permissions to the master page gallery to upload server-side code. Use extreme caution when adding this type of PageParserPath setting.

<SafeMode …>
<PageParserPath VirtualPath=”/_mpg/*” CompilationMode=”Always” AllowServerSideScript=”true” IncludeSubFolders=”true”/>

Application Pages :

  • Application pages are used to support application implementations in SharePoint Foundation.

  • Application pages are stored on the file system of the front-end Web server in the %ProgramFiles%Common FilesMicrosoft Sharedweb server extensions14TEMPLATELAYOUTS directory and exist for every site in a Web application.

  • This folder is mapped to an Internet Information Services (IIS) virtual directory called _layouts. Every site and subsite will have access to the application pages by using the _layouts virtual directory.

  • For example, http://myserver/_layouts/settings.aspx and http://myserver/subsite/_layouts/settings.aspx access the same application page on the front-end Web server unlike site pages, which are an instance for the specified site.

* Application pages are not subject to the same restrictions as site pages. They allow in-line code without restriction.

* They cannot, however, use dynamic Web Parts or Web Part zones or be modified using SharePoint Designer.

* Modifying the default application pages is not supported in SharePoint Foundation. Custom application pages can be added to a subdirectory inside the _layouts folder.

Access Requests Explained for SharePoint 2013 – With a Script to Assign Default Groups

One of the features of SharePoint that has been around is the ability for users that need access to a site, and are denied access, through the “Request Access” process.

To enable or review these settings,

  • go to “Settings” > “Site Settings” > “User and Permissions” and click “Access Request Settings”. In the “Access Request Settings” dialog box, select the check box next to “Allow access requests” then provide an email address of the individual you’d like to manage this feature.
  • If a site has multiple groups with the same permission levels (Owners, Members and Viewers) but there is not an assigned default group, then you will see the problem where access requests will either not display for the impacted user or an owner will not be able to approve requests.

Here’s a Windows PowerShell script to change each of the groups for a site so that each is identified as the default group for Members, Owners and Visitors

You’ll need to a the “Microsoft.SharePoint.PowerShell” add-in at the top of the script to get the SharePoint references.

#Members Group
$web = Get-SPWeb “
$groupToMakeDefaultMembersGroup = $web.Groups | ? { $_.Name -eq “Team Site Members” }
$web.AssociatedMemberGroup = $groupToMakeDefaultMembersGroup

#Owners Group
$web = Get-SPWeb “
$groupToMakeDefaultOwnersGroup = $web.Groups | ? { $_.Name -eq “Team Site Owners” }
$web.AssociatedOwnerGroup = $groupToMakeDefaultOwnersGroup

#Visitors Group
$web = Get-SPWeb “
$groupToMakeDefaultVisitorsGroup = $web.Groups | ? { $_.Name -eq “Team Site Visitors” }
$web.AssociatedVisitorGroup = $groupToMakeDefaultMembersGroup

#Enable Access Requests after it was disabled
$web.RequestAccessEmail = “”

If you turn off the feature, you will can re-enable the feature by adding an email address to the “RequestAccessEmail” property.

Hope this helps solving the problem around assigning default groups and enabling the Request Access feature in SharePoint 2013.