Brian Gerrity

Brian Gerrity

  • NA
  • 3
  • 644

How to pass web viewer identity to ps1 script?

Oct 14 2021 11:55 PM

I'm a newbe to Angular

I have a site set up using angular.  I have a page that displays infrastructure health.

This same page has a click to run a ps1 which in turn collects from a db, formats, and embeds into an email, then sends it.

I now have a request to track who executes the script. How do I pull the identity of the user who launched the script into a variable in the ps1? The script runs under the system account so "whoami" won't work :)  I've been trying to pass the identity via the controller to the ps1 as an argument without success.

Does anyone know if this is even possible?
If so, a syntax example would be greatly appreciated!

Thank you in advance


Answers (1)