Hello. I’m not only new to the community, I’m pretty much new to scripting which includes powershell and not to mention PSUD and i’m also not a coder. But I have managed to piece together a few scripts that have suited my purposes for monitoring some software I need to know that is or isn’t running. So here’s the trouble:
I’m running a PSUD desktop API on a remote PC that is not in my local network. I don’t need to worry about port forwarding because this PC has a public IP. The API i’m running is just a simple test, "get-process firefox. That’s it.
When I run the API in the PS console on the remote pc using:
“Invoke-RestMethod http://localhost:5000/get -Method GET”
it works. But, when I attempt to invoke the API from my laptop using the following:
“Invoke-RestMethod http://xxx.xxx.xxx.xxx:5000/get -Method GET”
“Invoke-RestMethod : Unable to connect to the remote server”
I tried everything I could find in the forums and online including; using “Invoke-WebRequest”, running the script with a variable, using -Uri, using https, putting quotes around ‘GET’ and several other things I can’t remember atm.
It’s clear that i’m very inexperienced in this world but I’m willing to learn in order to get the results that I’m after. I have successfully created a few PSU dashboards so far that i’m proud of but I seem to be out of my depth on this one. Any help would be appreciated.
Things you should probably know… Although I have a licensed version of PSUD desktop on my laptop, The remote PC with the simple API i’m trying to call is unlicensed (but in this case I don’t believe it matters). I am also running Powershell version 5.1 on the endpoint as well as my laptop.
Also, I would like to eventually determine whether a particular windows process is running or stopped in at least 5 different machines, take that info and update a single dashboard. I have managed to do this locally with 1 PC. Thanks