NOTE: this action type is not available in Office 365.

This action will execute any PowerShell script you provide. The script can run either under the identity of the current user (for example, the user raising the event, which causes the action to run) or the service account (application pool or SharePoint timer service, when the action is executed by the timer). When Impersonation is used and the action is triggered by an event or manually, the application pool account’s permissions are used.

The following variable are set up and ready to be used in your script:

  • $site – current site collection
  • $web – current site
  • $list – current list
  • $itemid – when current item exists and has an ID, current item’s ID

Note: SharePoint PowerShell snap-in is not initialized by default. If you plan to use SharePoint’s cmdlets (such as Get-SPWeb), add the following line at the beginning of your script:
Add-PSSnapin Microsoft.SharePoint.PowerShell

 

Farm Configuration

You must disable legacy CAS support to allow this action to run.

For manual and event driven actions: go to your web.config file for the web application and change legacyCasModel to "false":

<trust level="Full" originUrl="" legacyCasModel="false" />

Read more about it here.

For timer actions: locate OWSTIMER.EXE.CONFIG file on your timer server(s) inside the hive folder\bin.

(for example: C:\Program Files\Common Files\microsoft shared\Web Server Extensions\16\BIN\OWSTIMER.EXE.CONFIG)

Modify the enabled attribute in configuration>runtime>NetFx40_LegacySecurityPolicy to false

<NetFx40_LegacySecurityPolicy enabled="false" />

 

 

Last modified: 3/29/2021 1:44 PM
Loading...

Add your comment

Comments are not meant for support. If you experiencing an issue, please open a support request.
Microsoft partner logo
© 2005-2024 Infowise Solutions Ltd. All rights reserved.
Privacy | Cookie Policy | Accessibility | Cloud SLA