Showing posts from December, 2016

Controlling start options for SharePoint workflows in Visual Studio

When you build a reusable SharePoint workflow, it's useful to be able to control which start options are available. For example, if you only want your workflow to run once when an item is created, it makes sense to disable the "Changing an item will start this workflow" option.

SharePoint Designer provides some handy checkboxes that you can use to control your start options:

However, it's not immediately obvious how you can set these options for a Visual Studio workflow as the options aren't documented anywhere.

To control the start options for a SharePoint workflow in Visual Studio, you need to edit the feature element file that deploys your workflow. Within the feature element file, you need to add properties to the File element that deploys your Workflow.xaml file:

<?xmlversion="1.0"encoding="utf-8" ?> <Elementsxmlns="">   <ModuleName="[Workflow Name]"Url="wfsvc/1c…

Applying a Logo to Every Site in SharePoint Online

A quick post today on a fairly common problem - you're given a site collection on Office 365 that has grown organically with hundreds of nested sites, four or five levels deep in places. The various site owners have used many different versions of your company logo, and you want to reintroduce a degree of consistency by applying the same logo to every site in a site collection.

The most efficient way to do this is to run some client-side code from PowerShell. Basically you need to iterate over the subsites of a given site and set the Web.SiteLogoUrl property on every site. The easiest way to do this is to:
Install the excellent SharePointPnP.PowerShell cmdlets.Run a script something like the one below.# UpdateSiteLogos.ps1 # Jason Lee 5/12/16
# Variables $rootSiteUrl="https://[tenant][path]" $credentialManagerLabel="ianWilliamsAdmin" $logoUrl="/sites/[path]/SiteAssets/smile.png"
# Recursive function to set site logo on specified site # P…