Skip to main content
Nintex Community Menu Bar

Activate/Deactivate Nintex Features in a WebApplication via PowerShell

  • June 8, 2015
  • 0 replies
  • 183 views
  • Translate

Forum|alt.badge.img+10

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 CollectionsSites 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.  
  3. $NWSiteFeature = '0561d315-d5db-4736-929e-26da142812c5'
  4. $NWWebFeature = '9bf7bf98-5660-498a-9399-bc656a61ed5d'
  5.  
  6. foreach($feature in $(Get-SPWebApplication -Identity http://contoso.com).QueryFeatures([Guid]$NWSiteFeature)){
  7.  
  8. Write-Host "Processing $($feature.Parent.Url)"
  9.  
  10. Disable-SPFeature -Url $feature.Parent.Url -Identity $NWSiteFeature -Confirm:$false
  11.  
  12. Enable-SPFeature -Url $feature.Parent.Url -Identity $NWSiteFeature
  13.  
  14. foreach ($webFeature in $feature.Parent.QueryFeatures([Guid]$NWWebFeature)){
  15.  
  16. Write-Host "Processing $($WebFeature.Parent.Url)"
  17.  
  18. Disable-SPFeature -Url $webFeature.Parent.Url -Identity $NWWebFeature -Confirm:$false
  19.  
  20. Enable-SPFeature -Url $webFeature.Parent.Url -Identity $NWWebFeature
  21.  
  22. Write-Host "Completed $($WebFeature.Parent.Url)"
  23.  
  24. }
  25.  
  26. Write-Host "Completed $($feature.Parent.Url)"
  27.  
  28. }
 

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

Did this topic help you find an answer to your question?

Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie Settings