Joel's SharePoint Architect Blog

SharePoint 2013 Training, Architecture, Administration and Development

Subscribe Subscribe  View Joel Jeffery's profile on LinkedIn
joelblogs.co.uk | joelj.co.uk | joeljeffery.co.uk | jfdiphoenix.co.uk

Posts Tagged ‘SharePoint Administrator’

A while ago, a student of mine asked if it was possible to use the taxonomic alternative labels from the Managed Metadata Service as thesaurus items in SharePoint Server Search.

There’s no built-in way to do this, but it is possible to generate the required Xml with a little PowerShell.

The Concept

The Term Store contains Term Group, which content Term Sets, which in turn contain nested Terms. Each Term can have (optional) synonyms called Labels.

If we find all the Terms with Labels, we can write them out in the correct format as a chunk of Xml, and pipe it into a thesaurus file.

Thesaurus files for SharePoint Server Search are kept under the file path:

%ProgramFiles%\Microsoft Office Servers\14.0\Data\Office Server\Applications\GUID-query-0\Config

A sample thesaurus file is shown below:

<XML ID="Microsoft Search Thesaurus">
    <thesaurus xmlns="x-schema:tsSchema.xml">
        <diacritics_sensitive>0</diacritics_sensitive>
        <expansion>
            <sub>Internet Explorer</sub>
            <sub>IE</sub>
            <sub>IE8</sub>
        </expansion>
        <replacement>
            <pat>NT5</pat>
            <pat>W2K</pat>
            <sub>Windows 2000</sub>
        </replacement>
    </thesaurus>
</XML>

You can see the rationale for how this file works on and how to manage thesaurus files at TechNet.

The Script

The script below shows the principle. It iterates over the Terms in each Term Store and finds their Labels. Where the Label is not the same as the name of the Term itself, it represents a synonym and we add it to the Xml.

function Extract-SPThesaurusFromTermLabels
{
  param([string] $webUrl);
  $ts = Get-SPTaxonomySession -Site $webUrl;
  Write-Output "<XML ID='Microsoft Search Thesaurus'>"; 
  Write-Output "<thesaurus xmlns='x-schema:tsSchema.xml'>"; 
  $ts.TermStores | 
  % { $_.Groups | 
    % { $_.TermSets | 
      % { $_.Terms | 
        % { $_.Labels | 
          ? {$_.Term.Name -ne $_.Value} |
          % { 
            Write-Output ("<expansion><sub>" + $_.Term.Name + 
              "</sub><sub>" + $_.Value + "</sub><expansion>");
          } 
        } 
      } 
    } 
  }; 
  Write-Output "</thesaurus>"; 
  Write-Output "</XML>";
}

You can then pipe the output of this command to an Xml file, and optionally use this in the place of your existing Thesaurus file with something like this:

Extract-SPThesaurusFromTermLabels http://sharepoint > tsLANG.xml

As always, please back up your original Thesaurus files and check the output of this before you use it! Smile

Technorati Tags: PowerShell, Search, SharePoint, SharePoint 2010, SharePoint Administration, SharePoint Administrator

UPDATED: Fix Slow SharePoint 2010 System Performance with the CRL Check

Sometimes you need to install SharePoint 2010 in an environment where the servers do not have an effective Internet connection. This posses a big problem.

Most Microsoft assemblies and DLLs are digitally signed. Each time signed assemblies are loaded, default system behaviour is to check with the owner of the root certificate that the cert with which the assembly was signed is still valid. In the case of Microsoft assemblies, this means “phoning home” to read the Certificate Revocation List at crl.microsoft.com .

Whilst this is all very well and good if you have an Internet connection, sometimes you don’t have this luxury. Many web servers, for instance, don’t have outbound Internet accessibility. The CRL check will attempt to connect to Microsoft’s servers and then timeout, usually within 30-60 seconds.

With SharePoint, you’ll get a lot of delays in this scenario. One way to check if your server is affected by this condition is to open up a SharePoint Management Console PowerShell window and run the “STSADM -help” command. If it takes 30 seconds or more to display the usage instructions, then you will be experiencing really slow server performance.

See how long STSADM takes to load

Disabling the CRL Check

There are three workarounds to this problem, in reverse order of preference:

  1. Give your servers an outbound Internet connection
  2. Edit the hosts file at “%SYSTEMROOT%\\System32\\drivers\\etc\\hosts” to fool the CRL check into thinking your local machine is crl.microsoft.com by pointing it at 127.0.0.1 (localhost):
    Editing the HOSTS file in Notepad
  3. Edit the registry to disable CRL checking by setting the State DWORD to 146944 decimal (SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\WinTrust\\Trust Providers\\Software Publishing for both HKEY_USERS\\.DEFAULT and HKEY_CURRENT_USER) with the following lines of PowerShell:
    #the following statement goes on one line
    set-ItemProperty -path "HKCU:\\Software\\Microsoft\\Windows\\CurrentVersion
    \\WinTrust\\Trust Providers\\Software Publishing" 
     -name State -value 146944
    
    #the following statement goes on one line also
    set-ItemProperty -path "REGISTRY::\\HKEY_USERS\\.Default\\Software\\Microsoft
    \\Windows\\CurrentVersion\\WinTrust\\Trust Providers\\Software Publishing" 
     -name State -value 146944
    
    #UPDATED: and the following statement goes on one line too
    get-ChildItem REGISTRY::HKEY_USERS | foreach-object {set-ItemProperty -ErrorAction 
    silentlycontinue -path ($_.Name + "\\Software\\Microsoft
    \\Windows\\CurrentVersion\\WinTrust\\Trust Providers\\Software Publishing") 
    -name State -value 146944}
  4. UPDATED: Edit the machine.configs and disable it there. There’s a nice piece of code from the most excellent AutoSPInstaller (autospinstaller.codeplex.com) that does this:
  5. Write-Host -ForegroundColor White " - Disabling Certificate Revocation List (CRL) check..."
    ForEach($bitsize in ("","64")) 
    {            
      $xml = [xml](Get-Content $env:windir\\Microsoft.NET\\Framework$bitsize\\v2.0.50727\\CONFIG\\Machine.config)
      If (!$xml.DocumentElement.SelectSingleNode("runtime")) { 
        $runtime = $xml.CreateElement("runtime")
        $xml.DocumentElement.AppendChild($runtime) | Out-Null
      }
      If (!$xml.DocumentElement.SelectSingleNode("runtime/generatePublisherEvidence")) {
        $gpe = $xml.CreateElement("generatePublisherEvidence")
        $xml.DocumentElement.SelectSingleNode("runtime").AppendChild($gpe)  | Out-Null
      }
      $xml.DocumentElement.SelectSingleNode("runtime/generatePublisherEvidence").SetAttribute("enabled","false")  | Out-Null
      $xml.Save("$env:windir\\Microsoft.NET\\Framework$bitsize\\v2.0.50727\\CONFIG\\Machine.config")
    }

Method 3 is the preferred method, and should have things loading about as quickly as possible. UPDATED: Method 4 is more likely to work, but you’re editing some pretty important files there, so be careful!

UPDATED: You can download a script that combines these methods here: http://joelblogs.co.uk/wp-content/uploads/2012/03/Disable-CRLCheckv2.zip.

As usual, no warranty etc etc, use at your own discretion!

Technorati Tags: SharePoint, SharePoint 2010 Training, SharePoint Administration, SharePoint Administrator

SharePoint 2010 Service Pack 1 Released Today

Today’s Announcement

After a long wait, SharePoint 2010 SP1 is finally available.

What’s New in Service Pack 1 for SharePoint 2010

SQL Denali Support

Service Pack 1 introduces support for SQL Server Code Name “Denali”.

Shallow Copy

An improvement to the Move-SPSite PowerShell cmdlet, which means that when you move a Site Collection where you’re using the SQL Remote Blob Store for file storage, they can stay right where they are; it’s only database content (such as List, Library and other structure/metadata related content) that gets moved from one database to another.

Caveat: Shallow Copy does not support the Out-of-Box RBS provider (the Filestream Provider).

Site Recycle Bin

SharePoint 2010 SP1 Site Recycle BinMuch awaited, and much appreciated, is inclusion of the new Site Recycle Bin. Before SP1, if you deleted a site, it pretty much stayed that way. Lists, Libraries and Documents got into the Recycle Bin, but not Sites or Site Collections. You could install the free plug-in from Microsoft’s SharePoint Governance site, but it merely archived deleted sites rather than helping those who causally deleted the wrong site.

Storage Space Allocation – Storage Metrics

SharePoint 2010 Storage MetricsIn SharePoint 2010 RTM, Microsoft took away the Storage Management page (storman.aspx).

It’s back now with a new look, showing the top 100 biggest files or containers across a site collection.

Cascading Filters for PerformancePoint Services

A nice touch for Business Intelligence users: filters in PerformancePoint Dashboards can now cascade their values from one to the next.

Browser Support

Service Pack 1 brings support for Internet Explorer 9 (IE9) and IE8 Standards Mode, and now Google Chrome too!

Cumulative Updates

SharePoint 2010 Service Pack 1 includes all the (non-redacted) Cumulative Updates since the RTM:

Technorati Tags: SharePoint, SharePoint 2010, SharePoint Administration, SharePoint Administrator

About Me

Hi, and Welcome to my .NET and SharePoint Architecture Blog!

I’m a Microsoft Certified Trainer, a SharePoint Architect and a large scale Microsoft .NET implementation expert. I’m also a trained Enterprise Architect and experienced practitioner of Technical Due Diligence projects. I’ve recently started a series of video podcasts on SharePoint 2010. You can find links to them on this blog site, and also at iTunes (search for “joelblogs tv”).

I run a Microsoft Gold Certified Partner in the UK called JFDI Phoenix Ltd, and you can find us here: http://www.jfdiphoenix.co.uk.

Feel free to view my
View Joel Jeffery's profile on LinkedIn

Or drop me a line with the contact form below!

Your Name (required)

Your Email (required)

Subject

Your Message

Are we human? (required)

captcha

Technorati Tags: SharePoint Administrator, SharePoint Architect, SharePoint Developer