Thursday, March 14, 2013

Searches, by an International User, producing no results

This will be quick.

So I had an issue with a user from Beijing performing searches against a site, but no search results would appear. After some investigation, ie a couple of late nights of virtual troubleshooting sessions with the user, I discovered that SharePoint search was interpreting the query by way of the local language settings. Given that this user's local language was Mandarin, the English word searches he was performing did not make sense to SharePoint. To resolve his issue, it required me to adjust the default query language setup on the search results page. Here's how I did it:

I performed a search to navigate directly to the search results window. Next, the page was placed in edit mode. Under the "Search Core Results" webpart, I edited the properties. Expanding the "Results Query Options" section, I picked "English" as the default Query Language and saved my changes.

VoilĂ , it worked!

Wednesday, January 30, 2013

Universal PowerShell Script to Deploy SharePoint Solution Packages

So, I was tasked with deploying several solution packages to an SharePoint 2010 alpha environment. Obviously, task one was to gather all the packages to be deployed. Task two was going to turn into a tedious headache until I ventured off into the PowerShell scripting world. What resulted was a universal script that I could use going forward that would deploy any number of wsp files. Below follows the script that handles said deployment.

A couple of things to note:
   1. This script assumes that a ps1 script is generated and is included in the folder from which your WSPs will be deployed.
   2. You have access to a SharePoint server on the farm.


Set-ExecutionPolicy Unrestricted 


$fc = new-object -com scripting.filesystemobject
$curFolder = Split-Path ($MyInvocation.MyCommand.Path)
$folder = $fc.getfolder($curFolder)

foreach ($i in $folder.files) {
  IF ($i.name -like "*.wsp")
  {
    $fullPath = join-path $curFolder $i.name
    Add-SPSolution $fullPath
    Install-SPSolution -Identity $i.name -GACDeployment
  }
}


Write-host "SharePoint 2010 Solutions Have Been Deployed to the Farm"
Write-host "Review Central Administration For Accuracy"

Thursday, January 24, 2013

Extracting Solution Packages from SharePoint 2010 via PowerShell

There may come times when it becomes necessary to synchronize your SharePoint farms. In my experience, solution packages are virtual moving targets where developers apply changes willy-nilly. Thus, piecing together the contents of a solution package becomes a tedious and cumbersome task that distracts you from other time-sensitive projects.

Well, to speed up the process, you can use a shorthand approach by simply extracting the solution packages deployed to their respective content databases. How you ask? By way of Powershell. Here goes:
$solutions = [Microsoft.SharePoint.Administration.SPFarm]::Local.Solutions;

foreach ($solution in $solutions) {
        $solution.SolutionFile.SaveAs("c:\temp\packages\" + $solution.Name);
}