Forums: Powershell Script - Forums

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • This topic is locked

Powershell Script Rate Topic: -----

#1 User is offline   i.NoLim 

  • Advanced Member
  • PipPipPip
  • Group: Members
  • Posts: 71
  • Joined: 11-September 17

Posted 01 March 2018 - 04:41 PM

Hello,

Is it possible to launch a PowerShell script from a "After record added" event? If so, what would that event look like?
0

#2 User is offline   Pete K 

  • Advanced Member
  • PipPipPip
  • Group: Members
  • Posts: 223
  • Joined: 05-February 16

Posted 01 March 2018 - 07:57 PM

The short answer is yes. The long answer is you will need to roll up your sleeves. First of all make sure that the apppool in which your application runs has administrator rights. If that can't be achieved in your hosting environment, you're dead in the water.

Here's a general article on running PS scripts server-side from within an ASP.net app:

http://jeffmurr.com/blog/?p=142

To adapt this to ASPR.net, I'd think you would need to create a function within a custom code file to wrap the code, place that in your source/includes folder, and then call the function from within the appropriate ASPRunner event.

This topic describes my approach to using custom code files in the ASPR.Net framework: http://asprunner.com...stom-functions/

Hope this helps.


----------------------------------------------------------
Pete K.
Web Developer
Fayette County Public Schools | Lexington, Kentucky, USA
0

#3 User is offline   admin 

  • Administrator
  • PipPipPip
  • Group: Admin
  • Posts: 15794
  • Joined: 03-February 03

Posted 01 March 2018 - 10:20 PM

Check this one for instance:
https://www.codeproj...-scripts-from-C
Best regards,
Sergey Kornilov
0

#4 User is offline   i.NoLim 

  • Advanced Member
  • PipPipPip
  • Group: Members
  • Posts: 71
  • Joined: 11-September 17

Posted 02 March 2018 - 05:31 PM

Thank you very much for both replies, I'm definitely going to take look at these and report back.
0

Page 1 of 1
  • You cannot start a new topic
  • This topic is locked