Web front end for PowerShell

Status
Not open for further replies.

Cookie.Monster

Ars Scholae Palatinae
666
Hi all,

I'm looking to identify a framework for a web front end to PowerShell. I have light (very light, and very rusty) experience with programming, am comfortable with PowerShell.

The end result might be incorporated into internal customer facing websites, systems administration websites, etc. I typically encourage learning PowerShell itself (we are a Windows shop), but certain functions would be very helpful over a web front end. Ideally this is something I can pass on to our dev team for customer facing items, and something simple enough for our systems team to use for our own purposes.

Any suggestions? Any thoughts on the following options?
  • ASP.NET example, example
  • Management OData and PowerShell
  • PowerShell Pipeworks
  • PowerShell Web Server
  • vmware WebCommander fling
  • PowerShell Ad-Hoc Web Server

Leaning towards ASP.NET, but want to make sure I'm not missing anything.

PowerShell Web Access is already up and running and not an option for this.

Your insight would be greatly appreciated!

CM
 

Cookie.Monster

Ars Scholae Palatinae
666
I ended up going with ASP.NET. It was much easier than I expected. This example was quite helpful.

Now I'm trying to figure out if there is a standard way of prompting for credentials in ASP.NET. This way, I can prompt for credentials, pass these in to the pipeline and use them in whatever PowerShell code we run.

Using IIS Windows Authentication is an option as well and will likely be used in some scenarios, but for tasks where I need administrative credentials I would prefer to prompt for credentials rather than run $browser with an administrative account. Also gives flexibility for commands that must take in an actual credential, such as invoke-command with credssp.

Any tips on prompting for credentials in ASP.NET would be very helpful!
 

Cookie.Monster

Ars Scholae Palatinae
666
Yes - the idea is to provide a front end that (1) is friendly enough for a non-technical user and (2) could be used on devices that can't run PowerShell for some reason or another.

Example scenarios:
  • Application SME has various specific tasks that they know when to run on an application server. As is they ask an administrator to do this on the server, as the task requires administrative privileges. For pre-authorized tasks, we could provide a web front end they could hit to trigger these tasks.
  • On-call technical folks may occasionally get caught away from a computer, with a call that can be fixed with a simple, known resolution (restart service x, restart program y, restart computer z, clear files from some folder, run some pre-scripted solution, etc.). They log on to a web interface over a smart phone, authenticate as needed, resolve issue.

For technical users with access to a computer, we already have granular access via delegated, constrained PowerShell runspaces, PowerShell Web Access, and custom PowerShell functions.

I completely agree though. I will not provide a GUI for anyone in our IT department. Among other reasons, from my perspective they work in a predominantly Windows environment; they are not helping themselves or their employer if they are not familiar with or learning PowerShell. Building GUIs means I need to troubleshoot unnecessary layers, delays delivery of solutions, and provides a solution that discourages learning.... Unless you were talking about this from a security standpoint, which will be irrelevant for us due to various compensating controls before you can even hit the page.
 

Kilkenny

Ars Tribunus Angusticlavius
6,480
Subscriptor++
[url=http:/civis/viewtopic.php?p=25813831#p25813831:2k35jdfv said:
Cookie.Monster[/url]":2k35jdfv]Example scenarios:
  • Application SME has various specific tasks that they know when to run on an application server. As is they ask an administrator to do this on the server, as the task requires administrative privileges. For pre-authorized tasks, we could provide a web front end they could hit to trigger these tasks.
  • On-call technical folks may occasionally get caught away from a computer, with a call that can be fixed with a simple, known resolution (restart service x, restart program y, restart computer z, clear files from some folder, run some pre-scripted solution, etc.). They log on to a web interface over a smart phone, authenticate as needed, resolve issue.
A while back we did something like this (though the scripts were a mix of vbs & bat, not powershell). The solution we settled on was to set up the tasks in Task Scheduler along with all of the required permissions for each - but with no schedule/triggers specified.

Then set the tasks to be runnable on demand, and gave read/execute permissions to the IUSR account to the specific desired tasks (you can't do that through the Task Scheduler GUI, but go to the folder where the task files are saved & change the ntfs permissions on them).

Then invoke & execute the desired task from the ASP page.

I don't have code handy right now, but maybe I can look it up next week if the above isn't enough to Google on.
 
Status
Not open for further replies.