ARTICLE

SharePoint Workflow Settings for SharePoint 2010 Web Application

Posted by Vijai Anand Articles | SharePoint 2010 May 07, 2011
In this article we will be seeing how to manage SharePoint Workflow settings for SharePoint 2010 web application using object model and powershell.
Reader Level:

In this article we will be seeing how to manage SharePoint Workflow settings for SharePoint 2010 web application using object model and powershell.

Go to Central Administration => Web Applications => Manage Web Applications =>Select the Web Application.

In the ribbon interface go to Manage => General Settings => Workflow.

Share1.gif


You can modify the SharePoint Workflow Settings.

Share2.gif

The same can be achieved using SharePoint object model and powershell.

Using SharePoint object model:

  • Open Visual Studio 2010.
  • Go to File => New => Project.
  • Select the Console Application template from the installed templates.
  • Enter the Name and click on Ok.
  • Add the following assembly.

    • Microsoft.SharePoint.dll
     
  • Add the following namespaces.

    • using Microsoft.SharePoint.Administration;
    • using Microsoft.SharePoint;
     
  • Program.cs:

    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Text;
    using Microsoft.SharePoint.Administration;
    using Microsoft.SharePoint;

    namespace WorkflowSettings
    {
        class Program
        {
            static void Main(string[] args)
            {
                SPWebApplication webApp =SPWebApplication.Lookup(new Uri("https://anavijai.com/"));

                // -------------SharePoint Workflow Settings-------------------------------------
            }
        }
    }

Workflow Settings:

 //Enable user-defined workflows for all sites on this web application
webApp.UserDefinedWorkflowsEnabled = false;

//Alert internal users who do not have site access when they are assigned a workflow task
webApp.EmailToNoPermissionWorkflowParticipantsEnabled = false;

//Allow external users to participate in workflow by sending them a copy of the document
webApp.ExternalWorkflowParticipantsEnabled = true;

Update the changes:

//Update the changes
webApp.Update();

Using powershell:

$webApp = get-spwebapplication "https://anavijai.com/"
 
# -------------SharePoint Workflow Settings-------------------------------------

#--------------Enable user-defined workflows for all sites on this web application
$webApp.UserDefinedWorkflowsEnabled = $false
#--------------Alert internal users who do not have site access when they are assigned a workflow task
$webApp.EmailToNoPermissionWorkflowParticipantsEnabled = $false
#--------------Allow external users to participate in workflow by sending them a copy of the document
$webApp.ExternalWorkflowParticipantsEnabled = $true

#--------------Update the changes
$webApp.Update()

 

Login to add your contents and source code to this article
post comment
     
COMMENT USING
PREMIUM SPONSORS
Over-C is a holistic consortium of communications and technology specialists. We build, deploy and market both business as well as consumer products and solutions.
Get Career Advice from Experts
SPONSORED BY
  • PDF reports have never been easier to create. With our included WYSIWYG Designer, you can layout your reports, set up your data source and let DynamicPDF ReportWriter do the rest.