Dave's Technophorical Times

A blog about Microsoft's Technologies!
SharePoint :: MVC :: ASP.NET :: IIS :: SQL Server :: Visual Studio :: MS Access

Problem:

Recently our content source for the sharepoint sites no longer crawls and instead throws up the Error HRESULT E_FAIL has been returned from a call to a COM component

I had a look on the web and the only solution has been to change impersonation settings from false to true in the web config. Unfortunately ours was already set to true and I still have this error. Cannot get the crawl to work in sharepoint now.

Resolution:

Check the web application's website in IIS 7.

Under Authentication, make sure ASP.NET Impersonation is ENABLED. Mine was disabled and caused this error. If you have applications in SharePoint that need this disabled, you might want to extend the web application it another IIS website and Disable impersonation for users, keeping the default web application's zone enabled for search crawls on that URL.

Ensure this is set for each of the Web Applications that you wish to crawl.

Another common Crawl issue is using an AD service Account that has not been added to the SharePoint Managed Accounts.



Initial Blog:
http://blogs.technet.com/b/sushrao/archive/2011/12/01/sharepoint-2010-exception-microsoft-sharepoint-administration-spupdatedconcurrencyexception.aspx

I just want to make sure I never lose this information!

After applying a cumulative update\ service pack on SharePoint Servers when we run psconfig.exe -cmd upgrade -inplace b2b –wait -force it fails on step 3 with the error message

"Exception: Microsoft.SharePoint.Administration.SPUpdatedConcurrencyException: An update conflict has occurred, and you must re-try this action. The object SPUpgradeSession Name=Upgrade-20110604-023550-824 was updated by Topgear\administrator, in the PSCONFIG (4272) process, on machine SharePoint2010. View the tracing log for more information about the conflict"

Resolution:

Open command prompt on the SharePoint Server (Run as Administrator)

Navigate to following location

C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\Bin

Execute:

stsadm -o setproperty -pn command-line-upgrade-running -pv Yes

Note: Running the above command on the SharePoint server will reset the command-line-upgrade-running property where an upgrade process stopped responding. Also, this command needs to be executed on each SharePoint Servers in the farm after the upgrade completes successfully on first server

Later, execute following to initiate the upgrade process again.

psconfig.exe -cmd upgrade -inplace b2b –wait –force

Note: If the upgrade fails with any errors re-view the upgrade.log file as it would contain detailed information to troubleshoot.



Problem: In SharePoint 2010, I created a new site template from an existing site and a new site using this template. After deleting the new site and I cannot deactivate the site template to be able to remove it. Here's the exception I get:
System.ArgumentException: Value does not fall within the expected range. Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. Stack Trace: [ArgumentException: Value does not fall within the expected range.] Microsoft.SharePoint.SPWebCollection.get_Item(Guid id) +27763375 Microsoft.SharePoint.SPFeatureEnumeratorBase.GetCachedWeb(SPSite site, Guid webId, Guid featureId) +252 [SPFeatureIsOrphanedException: Unable to access web scoped feature (Id: 5c143ca0-e513-4fa5-93a6-a926352c982e) because it references a non-existent or broken web (Id: 196cdf6e-d4a1-4cb6-b962-591aaa3c5f43) on site 'http://win-9o8m2cks1v7'. Exception: System.ArgumentException: Value does not fall within the expected range. at Microsoft.SharePoint.SPWebCollection.get_Item(Guid id)
Solution: Go to the Site Settings page for the root web of your site collection. Under the heading Site Collection Administration, click the Recycle bin link. On the QuickLaunch menu, select End User Recycle Bin items, then select all the items that appear and click the Delete Selection link at the top of the items list. Now select Deleted From End User Recycle Bin from the QuickLaunch Menu and do the same.
Now return to the solution gallery and you should be able to deactivate and delete your solution.


How to attach multiple files to a single list item, such as a Task List. Most people know about the “Upload Multiple Documents” option in document libraries. This option isn’t there with list items.

What you can do is attach files individually. You can keep attaching as many files as you like.

  1. Click Attach File from the ribbon
  2. Select first file you want attached
  3. Repeat

The files will now be listed in the “Attachment” section of your list item properties.



If your Search Engine crawl is not returning any "Content" results from a Full Crawl, i.e. pdf, docx files are not being returned then you probably need to register the mssph.dll file. Note that PDF content searching will require Adobe iFilter.

Start-->Run

regsvr32 "C:\Program Files\Common Files\Microsoft Shared\web server extensions\14\BIN\mssph.dll"

Try Full crawl and it should work.

 



The message can be ignored, or can it? http://technet.microsoft.com/en-gb/library/hh344223.aspx. It only states since if you use an account in local admin group it gives that account the right to execute malicious codes without even prompting to execute.

Add the farm account into the local administrators group. This is stated in the TechNet article:http://technet.microsoft.com/en-us/library/ee721049.aspx

"The Server Farm account, which is created during the SharePoint farm setup, must also be a member of the Administrators group on the server where the User Profile Synchronization service is deployed."

There seems to be some conflicting opinions about the correct permissions, as this will cause the SharePoint Health Analyzer to create a warning:

"Accounts used by application pools or service identities are in the local machine Administrators group. Using highly-privileged accounts as application pool or as service identities poses a security risk to the farm, and could allow malicious code to execute."

Also grant the Replicate Directory Changes [http://support.microsoft.com/kb/303972] permission for the farm account. Reboot the server to make sure that all the services using the farm account run with the new privileges.

Make this a point for site app pools:
As a SharePoint best practice, please refrain from using built-in machine administrator account for any SharePoint site app pools (services, application pools).

From the article on technet: http://technet.microsoft.com/en-us/library/cc678863(office.12).aspx (though the article is for MOSS 2007, it is still relevant)

The other application pool account must be a domain user account. This account must not be a member of the administrators group on any computer in the server farm.



Just a quick solution in case you ever get the following message when trying to open a SharePoint Document Library in explorer view from Windows Server 2008

Your client does not support opening this list with Windows Explorer.

This is due to the fact that Explorer view uses the WebDav protocol to connect to SharePoint from the client. As Windows Server is not designed to be a client, the WebDav client is not installed or enabled by default.

In order to enable the WebDav client on a server,simply enable the Desktop Experience feature.



Adobe PDF iFilter lets you index Adobe PDF documents in Microsoft SharePoint Server 2010 and Microsoft SharePoint Foundation 2010.

To install and configure Adobe PDF iFilter 9 in SharePoint Server 2010 and SharePoint Foundation 2010, follow these steps:

  1. Install Windows Server and SharePoint. This step includes the following tasks:
    • Install Windows Server 2008.
    • Install the SharePoint prerequisites. To do this, run the Microsoft SharePoint Products Preparation tool.
    • Install SharePoint 2010 and run the SharePoint Products Configuration Wizard.
    • Configure a server farm topology. For example, configure a Single Server Farm.
    • Create and configure a new Search Service application.
  2. Download and install Adobe PDF iFilter 9. For more information about how to download PDF iFilter 9, see Adobe PDF iFilter 9 on the Adobe Downloads website.

  3. Download the Adobe PDF file icon. For more information, see Use of Adobe icons and web logos on the Adobe website.

    Note Save the Adobe PDF file icon to the following file location:

    \Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\TEMPLATE\IMAGES\
  4. Add the mapping entry to the docIcon.xml file. To do this, follow these steps:
    1. Open the docIcon.xml file in Notepad.

      Note The docIcon.xml file is located in the \Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\TEMPLATE\XML folder.
    2. Type the following entry in the docIcon.xml file:

      <Mapping Key="pdf" Value="pdf16.gif" />
    3. Click Save.
    4. Exit Notepad.
  5. Add the .pdf file type to the SharePoint content index.
  6. Click Start, type regedit in the Search programs and files box, and then press Enter.
  7. Locate the following registry key:

    HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Office Server\14.0\Search\Setup\ContentIndexCommon\Filters\Extension
  8. Right-click Extension, click New, and then click Key.
  9. Type .pdf, and then press Enter.
  10. Click .pdf, right-click (Default), and then click Modify.
  11. Type the following GUID in the Value data box:

    {E8978DA6-047F-4E3D-9C78-CDBE46041603}
  12. Exit Registry Editor.
  13. Restart the SharePoint Search Service.
  14. Restart all the SharePoint servers in the server farm.


Adding Columns to a SharePoint List across an entire Site Collection should be done like this using PowerShell (with Power GUI):
 
Note that the use of the following works with all the defaults... 
$fieldDateTime = [Microsoft.SharePoint.SPFieldType]::DateTime
$list.Fields.Add("Compliance Date",$fieldDateTime,$false) 

However, you get MORE Control over Field Attributes using this method:
$fldXml = "<Field Type='DateTime' DisplayName='Report Sign Off Date' Format='DateOnly' Name='Report Sign Off Date'/>"     
$list.Fields.AddFieldAsXml($fldXml) 
 
Both methods are used in the code block below. 
if ((Get-PSSnapin | ? { $_.Name -eq "Microsoft.SharePoint.PowerShell" }) -eq $null) {
    Add-PSSnapin Microsoft.SharePoint.PowerShell
}
[Microsoft.SharePoint.SPSecurity]::RunWithElevatedPrivileges( 
{
 $site =  Get-SPSite -Identity "https://mysite.com/sites/thissite"
 Write-Host "Script Started"
 [array]$ListNames = "ListA", "ListB"
 $NumberofReportsinRecordFound = $false
 $ReportSignOffDateFound = $false
 $ComplianceDateFound = $false
 foreach($web in $site.AllWebs)
 {
  #Get number if Lists rather than using foreach as we will be modifying the List
  
  for($i=0; $i -lt $web.Lists.Count; $i++)
  {
   $list = $web.Lists[$i]
   if($list.BaseType -eq "DocumentLibrary" -and $list.BaseTemplate -notmatch "Catalog")
   {
    Write-Host $web.Title
    Write-Host $list
        
    $NumberofReportsinRecordFound = $false
    $ReportSignOffDateFound = $false
    $ComplianceDateFound = $false
      
    if($ListNames -contains $list.Title)
    {
     for($j=0; $j -lt $list.Fields.Count; $j++)
     {
      $field = $list.Fields[$j]
      if($field.Title -like "*do not use*")
      {
          Write-Host "do not use deleted!"
       $list.Fields.Delete($field)
       $list.Update() 
      }
      
      if($field.Title -like "Number of Reports in Record")
      {
       $NumberofReportsinRecordFound = $true
      }
      if($field.Title -like "Report Sign Off Date")
      {
       $ReportSignOffDateFound = $true
      }
      
      if($field.Title -like "Compliance Date")
      {
       $ComplianceDateFound = $true
      }
     }
        $fieldNumber = [Microsoft.SharePoint.SPFieldType]::Number

     if(!$NumberofReportsinRecordFound){
      $list.Fields.Add("Number of Reports in Record",$fieldNumber,$false)
      $fld = $list.Fields["Number of Reports in Record"]
     }
     
     if(!$ReportSignOffDateFound){
      $fldXml = "<Field Type='DateTime' DisplayName='Report Sign Off Date' Format='DateOnly' Name='Report Sign Off Date'/>"
      $list.Fields.AddFieldAsXml($fldXml)
     }
     
     if(!$ComplianceDateFound){
      $fldXml = "<Field Type='DateTime' DisplayName='Compliance Date' Format='DateOnly' Name='Compliance Date'/>"
      $list.Fields.AddFieldAsXml($fldXml)
     }
     $list.Description = "Inspection Reports"
     $list.Update()
    }
   }
  }
 }
 $web.Dispose()
 $site.Dispose()
 Write-Output "Script Ended"
}
)


Note that you must run the
psconfig.exe -cmd upgrade
command after applying the Update!
 


The Blogger

Dave Stuart I'm a Developer with a passion for coding. I enjoy the challengers that come with the job! SharePoint is one of my expert areas along with .NET Web Development with MVC and good old MS Access VBA coding. I Blog so that I can remember how I did that way back when; PLUS all this stuff is searchable! I constantly study and run my own business, Dafran Inc. I have passed 22 Microsoft Exams since 1998 when I first jumped on the treadmill of knowledge. I hope that you enjoy this Blog as much as I enjoy updating it. All the very best from Calgary, Alberta, Canada. contact me at linkedin @ dafran.ca

Calendar

<<  September 2017  >>
MoTuWeThFrSaSu
28293031123
45678910
11121314151617
18192021222324
2526272829301
2345678

View posts in large calendar

Sign in