Posts

Showing posts from October, 2010

Powershell Script that will deploy/upgrade Farm Based Solution to all Site Collections

This Powershell script can be used to deploy/upgrade your farm solutions to all the site collections in the farm. # SharePoint DLL [void][System.Reflection.Assembly]::LoadWithPartialName("Microsoft.SharePoint") #Cmdlet Install Add-PSSnapin Microsoft.SharePoint.PowerShell -ErrorAction SilentlyContinue ###REGION FUNCTIONS ##################################################################### #Adds a farm solution to a site. ##################################################################### function AddSolution() { $myError = $null Add-SPSolution -LiteralPath $Solution -ErrorAction:SilentlyContinue -ErrorVariable myError -Confirm:$false if ($myError -ne $null) { write-host -ForegroundColor 'red' $myError $myError = $null } else { write-host -ForegroundColor 'green' "Sucessfuly added the solution to the site" } } ##################################################################### #Deploys...

Apply Custom StyleSheet to the SharePoint 2010 Publishing site.

When you are implementing a custom stylesheet for a publishing site in SharePoint 2010, make sure that the custom stylesheet is the first one that is declared, like the declaration below, and also specify the value of the "After" attribute as nightandday.css. If this is not done then you will see that the nightandday stylesheet will still override some of the classes.   A good way of debugging the styles that are applied in SharePoint is to navigate to the SharePoint page in IE 8.0 or higher and press F12 key. This will open the developer tools window and you can navigate to the HTML element and look at the styles are being applied or overridden.

Workflow does not start automatically when items are created by a Web Application in SharePoint 2010

We had a Users list in SharePoint 2010 to which a workflow was attached. This workflow fires off when a item is created in the Users list. The Users list was getting populated through a web application which would let the users enter the data and then save the data to the Users list using the ClientContent object.         During testing, we made the application pool for the custom web application run under the same user as that of the SharePoint 2010 web application. This caused a wierd behaviour in that the items were getting written the User list but the workflow was not firing. There were no errors in the application logs, SharePoint logs or anywere else.        Turns out that SharePoint 2010 has a security feature that will prevent the workflow from starting automatically when items are created in a list from a custom Web Application which has the same Application Pool credentials as the SharePoint Application Pool. ...