Rest calls and invoke command

Hey Guys, has anyone had any success with creating RestAPI that call invoke-command?

That sounds dangerous. What are you trying to do?

1 Like

I know… I have a scenario where a script is executed via invoke command on an array of servers to collect web properties, since for the most part the iisadministration module cmdlets are local commands, figured this would be my only option.

I would stick with Invoke-Command.

If you can’t, because these servers are in a DMZ that you want to limit access, I would put the the script on a single server behind a Universal Dashboard API. Make one cal to it, and it reaches out to the other servers to gather the information. The script is stored locally and is trusted, and you aren’t open to execution of arbitrary untrusted code.

Tim Curwick

@MadWithPowerShell these boxes are all on the inside, so shouldnt be a biggy this is purely for poc purposes too ;), just wanted to get takes on how others were utilizing or going about a situation, where invoke-command is a must.