SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I need to update a SharePoint list whenever a datachange happens in the sql cuastom table. I am trying achieve this by writting a trigger in the sqltable and calling PowerShell script to update list in the trigger.

Can anyone tell me the syntax to call the PowerShell script in the trigger?

i was using tthe command below for executing the PowerShell script in sql

xp_cmdshell 'c:\change.ps1 -Application_Number 100'

It gives me an error c:\change.ps1 is not recognized as an internal or external command

share|improve this question
up vote 0 down vote accepted

You can create a small Stored Procedure and create a Trigger within, to execute the PowerShell (1.0 or 2.0) script using xp_cmdshell. Here is a small example on how to do it

P.S. But I sincerely hope that you won't manipulate directly with SharePoint related configuration or content databases since it is not supported by Microsoft.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.