aaron.labiosa@nintex.com

Activate/Deactivate Nintex Features in a WebApplication via PowerShell

Blog Post created by aaron.labiosa@nintex.com Champion on Jun 8, 2015

Products: Nintex Workflow 2013, Nintex Workflow 2010

 

A request came in a few days ago for a way to programmatically toggle Nintex Features for all Site Collections\Sites that utilize Nintex Workflow in a given Web Application

 

This PowerShell script will disable and then re-enable all Nintex Features in the WebApplication (as long as they were previously enabled).

 

PowerShell Script
  1. Add-PSSnapin Microsoft.SharePoint.PowerShell -ErrorAction SilentlyContinue
  2. $NWSiteFeature = '0561d315-d5db-4736-929e-26da142812c5'
  3. $NWWebFeature = '9bf7bf98-5660-498a-9399-bc656a61ed5d'
  4. foreach($feature in $(Get-SPWebApplication -Identity http://contoso.com).QueryFeatures([Guid]$NWSiteFeature)){
  5. Write-Host "Processing $($feature.Parent.Url)"
  6. Disable-SPFeature -Url $feature.Parent.Url -Identity $NWSiteFeature -Confirm:$false
  7. Enable-SPFeature -Url $feature.Parent.Url -Identity $NWSiteFeature
  8. foreach ($webFeature in $feature.Parent.QueryFeatures([Guid]$NWWebFeature)){
  9. Write-Host "Processing $($WebFeature.Parent.Url)"
  10. Disable-SPFeature -Url $webFeature.Parent.Url -Identity $NWWebFeature -Confirm:$false
  11. Enable-SPFeature -Url $webFeature.Parent.Url -Identity $NWWebFeature
  12. Write-Host "Completed $($WebFeature.Parent.Url)"
  13. }
  14. Write-Host "Completed $($feature.Parent.Url)"
  15. }

To use the script do the following:

  • Replace http://contoso.com with the URL of the WebApplication you wish to execute the script against.

 

Version History and other scripts can be found here: http://alps.codeplex.com

Outcomes