User Profile
francois77
Copper Contributor
Joined Oct 09, 2019
User Widgets
Recent Discussions
Re: SharePoint Online/PnP/PowerShell: Update the workflow subscription by setting it to enabled to false
I finally found a solution: $ctx = Get-PnPContext $lst = Get-PnPList -Identity "Lists/list_Name" $wfs = Get-PnPWorkflowSubscription -Name "WF_Name" -List $lst $WorkflowServicesManager = New-Object Microsoft.SharePoint.Client.WorkflowServices.WorkflowServicesManager($ctx, $ctx.Web) $WorkflowSubscriptionService = $WorkflowServicesManager.GetWorkflowSubscriptionService() $ctx.Load($WorkflowServicesManager) $ctx.Load($WorkflowSubscriptionService) $ctx.ExecuteQuery() $wfs.Enabled = $false $WorkflowSubscriptionService.PublishSubscriptionForList($wfs, $lst.Id) | Out-Null $ctx.ExecuteQuery() I mixed PnP and CSOM (in bold). May be a more beautiful solution exists, but in this case it works.4.2KViews0likes0CommentsSharePoint Online/PnP/PowerShell: Update the workflow subscription by setting it to enabled to false
I try to update the "Enabled" property of a workflow subscription in SharePoint Online with PnP PowerShell but nothing append. My goal is to set programmaticaly this action as in UI when you can navigate to the Remove Workflow (RemWrkfl.aspx) page end then choose "No New Instances". Here it is what I do: Import-Module SharePointPnPPowerShellOnline -DisableNameChecking Connect-PnPOnline -Url "web_site_url" $wfs = Get-PnPWorkflowSubscription -Name "WF_Name" -List "Lists/list_Name" $wfs.Enable = $false After this last command, I don't know what I need to do to activate this new property. Can anyone help me, please?Solved4.2KViews0likes1Comment
Recent Blog Articles
No content to show