Hi, this is a bit of a newbie question so please bear with me.
I know how to use PSU in my internal network to run scripts and get information across my servers as I obviously know the names of my servers so can use commands with -ComputerName for example to get the information.
But how do I use it when hosting in Azure (or in my case as per discussion here with a ASP.NET hosting provider) to run commands / scripts on the connecting client computer? as it could be any computer opening my webpage and logging into my dashboard with provided credentials and I won’t know the name of that computer to use with -ComputerName (or perhaps Invoke-Command)?
And related to this what issues will I face and how do I overcome them in relation to permissions / security when a user accesses my dashboard via website externally like this (compared to doing it via an internal network for example?)
Many thanks, and apologies for the “newb” question - but eager to learn here.
This isn’t something that is easily accomplished. Running arbitrary scripts on a machine from a web browser is a huge security risk so you’d have to have some sort of system setup on the client machines to accommodate this.
If you can setup something like an Azure Gateway to connect from the Azure VM running PowerShell Universal down to your local networking, then you might be able to use PowerShell remoting like you are suggesting. Retrieving the actual computer name (or local IP address) from the web browser comes with set of issues but it may be possible.