Geeks With Blogs


Steve Clements .Net and then some.... March 2012 Entries
PowerShell script to find where in a site collection a specific feature is enabled.
It’s not an uncommon task to want to find out in what webs you have a specific feature enabled. This little script does just that, taking 2 params (site collection url, feature name) and simple output the SharePoint web url. Nothing fancy, but certainly a useful script to have in your toolbox! A good example of this is where you are using content publishing going from an Enterprise internal farm to a Foundation external farm, certain feature won’t be in the Foundation farm and will cause the Content ......

Posted On Friday, March 9, 2012 3:21 PM

Gotcha: 403 and 401 errors in SharePoint using Anonymous access
Recently I came up against a problem where I was getting 401 Unauthorized and 403 Forbidden errors in SharePoint on an extended anonymous only site. It worked perfectly when using windows authentication, for any level of user. In the end I tracked the problem down to accessing SPContext.Current I found this article which states you should use SPSecurity.RunWithElevatedP... when using the current context and it worked!! A little surprising, but not unexpected the SharePoint logs showed nothing ......

Posted On Friday, March 9, 2012 2:24 PM

Enable Publishing Approval workflow on all SP Web(s) in an Site collection with Powershell
What you need / What you've got? Pretty obvious, when a user edits/changes a page, you need someone to check its all good before it goes live! Aka Publishing Approval You can use the "Publishing site with workflow" template or enable it manually or set it up in your custom site definition.'ve got an entire site collection full of web sites and you need to do it "en-mass" … step up Powershell. A common scenario could be you were working in Stage or Pre-go live and having Approval workflow ......

Posted On Tuesday, March 6, 2012 6:19 PM

SharePoint 2010 set ‘Start this workflow to approve publishing a major version of an item’ with Powershell
Took me a little while to figure this one out, you’ve assigned your workflow to a library and you can set all other other flags like “AllowStartChange” and “AllowStartCreate”, but cant see how to set “Start this workflow to approve publishing a major version of an item.” That’s because its a property on the library itself called “DefaultContentApprovalWork... So you might want to do something like this…where you have the WorkFlow Association object ($wfAssociation) and the list/library ($list). ......

Posted On Tuesday, March 6, 2012 11:52 AM

Copyright © Steve Clements | Powered by: