Category Archives: PowerShell

Enterprise Search query giving FaultException when using an ORDER BY

Ran into this on a project when using the “FullTextSqlQuery” object to query against the Enterprise Search Service of SharePoint 2010. Had a query that included an Order By clause on my own Managed property other than the normal RANK. string query = “SELECT Title, ItemContentType, Projectnaam, Projectnummer, Projectomschrijving, Projectstatus, Projectlocatie, DeelprojectVan, Thema,Opdrachtgever,Projectlogo, Path, Rank,… Read More »

SharePoint and Web.config modifications

Ever since MOSS 2007 we all know the Web.Config Modifications Manager within the SharePoint API. But today I stumbled upon this PowerShell commandlet: Add-WebConfiguration. This commandlet is from the IIS7(.5) powershell module WebAdministration. The short version is, you can use this in you deploy script to do Web.Config modifications Example for an AppSettings Configuration Key:” Add-WebConfiguration… Read More »

Custom SPJobDefinition and “Access denied” error

If you create a custom SPJobDefinition and use a Feature Event Receiver to deploy and install this (Timer) SPJobDefinition you receive an error when you call the Update() method: “Access Denied” How to code and install a SPJobDefinition Paul Kotlyar found this on the subject: “Upon detailed investigation of Microsoft.SharePoint.dll  I discovered that SharePoint guys added a… Read More »

Download a solution from your Farm (SP2100)

Wanted to download a solution from my farm. So did it with PowerShell: param([string]$folder) write-host “” write-host -f Green “Get Solutions from Farm – Stef van Hooijdonk – v1.0” write-host “” $snapin=”Microsoft.SharePoint.PowerShell” if (get-pssnapin $snapin -ea “silentlycontinue”) { write-host -f Green “PSsnapin $snapin is loaded” } else { if (get-pssnapin $snapin -registered -ea “silentlycontinue”) {… Read More »

Claims Based authentication and the PublishingCache

If you are using Claims Based Authentication on your WebApplication then the Publishing Cache doesn’t work properly. Have a look into your Developer Dashboard to see what is going on: The warning and critical error are: 7362 – Warning Publishing Cache 7363 – Critical Publishing Cache Why is this? Because with Claims Based Authentication the Cache… Read More »

Doing Unit Testing with TFS2010 and SP2010

SharePoint 2010 has a wonderfull new developers experience with Visual Studio 2010 and great integration with Team Foundation Server 2010. We configured our TFS Build server to build our SP2010 solutions fairly easy. Just make sure the SP2010 dll’s you reference in your SP2010 projects are available on the TFS Build Server (in the GAC… Read More »

Small Powershell scripting tip

Want to log the output of your powershell script? use “Start-Transcript”! Top of your powershell script: ## Start logging $LogTime = Get-Date -Format yyyy-MM-dd_h-mm $LogFile = “$env:USERPROFILEDesktopDeploy-$LogTime.rtf” Start-Transcript -Path $LogFile -Force and put this at the end of your script: Stop-Transcript Invoke-Item $LogFile

Powershell and SP2010 (2) – Installing a solution

After reading this blogpost: WaitForWSPJob tool by MIchel Barneveld i had an idea, in SP2010 we can use Powershell to do the waiting because we can access the OM directly. $file = Get-ChildItem $solution $solutionID = $file.Name; $farm = Get-SPFarm $sol = $farm.Solutions[$solutionID] if($sol){    Write-Host -f Green “Going to uninstall $solutionID”    if( $sol.Deployed -eq… Read More »