Thank You For Stopping By

Marwan Ghayad

IT Functional and Technical Consultant

Resume

Resume

MS Transcription

MS Transcription

Instagram

  • Instagram Image
  • Instagram Image
  • Instagram Image
  • Instagram Image
  • Instagram Image

SharePoint Designer Workflow

With Microsoft SharePoint Designer, you can design no-code workflow solutions that manage simple to more complex business processes in an organization. Workflows add logic to both system and human processes. Workflows for system processes might update one data source when another data source changes. Workflows for human processes might send a document, such as an expense report, to an employee’s manager for approval and, if approved, on to the accounting department for processing.

This post shows you how it is easy to run SharePoint Designer workflow every day using power shell scheduled by windows schedule tasks tool, windows schedule tasks tool can  be used on many cases

 

Tools required:

  • SharePoint Designer
  • Powershell
  • Windows Schedule Task

Steps:

  1. Create your workflow using SharePoint Designer
  2. Build your Command in Powershell:

Add-PSSnapin microsoft.sharepoint.powershell

#Site: Site url

$web = Get-SPWeb -Identity “#site”

$manager = $web.Site.WorkFlowManager

#ListName:Name of your list

$list = $web.Lists[“#listName”]

#WorkflowName: Name of your SharePoint Designer Workflow

$assoc = $list.WorkflowAssociations.GetAssociationByName(“#workflowName”,”en-US”)

$data = $assoc.AssociationData

$items = $list.Items

foreach($item in $items)

{

$wf = $manager.StartWorkFlow($item,$assoc,$data,$true)

}

$manager.Dispose()

$web.Dispose()

 

Final Powershell will be:

Open Notepad and save the Powershell with name startwf.ps1 in your server

Add-PSSnapin microsoft.sharepoint.powershell

$web = Get-SPWeb -Identity “http://siteurl”

$manager = $web.Site.WorkFlowManager

$list = $web.Lists[“listName”]

$assoc = $list.WorkflowAssociations.GetAssociationByName(“workflowName”,”en-US”)

$data = $assoc.AssociationData

$items = $list.Items

foreach($item in $items)

{

$wf = $manager.StartWorkFlow($item,$assoc,$data,$true)

}

$manager.Dispose()

$web.Dispose()

3. Create you schedule task from windows Task Schedule

Create Trigger with date/time

SharePoint Designer

Create New Actions

SharePoint Designer

 

Program/Script:

C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe

Add argument (optional): location of your powershell

&’I:\StartWf\RunWorkflowDialy.ps1′

 

Post a comment or contact me for any questions or help that we can provide for you, hope those information are helpful for you,..See you again on new post

 

Sea Also:

 

Leave a Reply