Running a server based powershell script from a pc

Hi,
I’ve created a powershell script that runs a couple of server based programs. It is normally a scheduled process but I am now asked to provide a “normal” user to run the process. The PS1 needs to be on the server as the software it integrates with only resides on it.

I’ve done some searching but can’t seem to get my head around the best method. Ideally I would want the user to click a button on a internal webpage, or double click a shared executable. and for that to trigger the PS script to execute on the server (not on the clients PC)

any help would be greatly appreciated.

Thanks

Just to be clear I’ve used the invoke-command -server… option on the client PC it works up to the point where the script opens another program

In the first instance it invoke a SQL query and exports it to a file. It won’t get past this

Roo,
Welcome to the forum. :wave:t4:

So you actually don’t want this script to be run by another user - you want another user to trigger the scheduled task, right? :wink:

If that’s the case you may use

to trigger the task on the server.

Just to precise - Invorke-Command does not have a parameter -Server !! :wink:

1 Like

Thanks for your reply and welcome

  1. So I can allow the user to trigger a scheduled task remotely? I’ll look that up

  2. I just removed the rest of the script :smiley: - it did work… up to opening the sql part.

Just click on the link I posted … it’s the documentation?! :man_shrugging:t4:

I didn’t get that. And it does not make that much sense to talk about a script if we don’t see the actual code. :man_shrugging:t4:

Perfect - Works a treat - thanks for the heads up :smiley: