VMware Cloud Community
stromcooper
Contributor
Contributor

Establishing a PowerCLI execution web/email server

I work at a large healthcare company that is upward of 86% virtualized now, however precious few individuals are very PowerCLI savvy.  Several are becoming more familiar with the output / results of PowerCLI scripts and are looking to leverage them, however that could spread to ~20 different engineers with greatly varying degrees of technical knowledge and I'm looking for a way to simplify execution for them.  Having simply emailed them scripts before, it seems impossible to guarantee that everyone has a correctly configured environment for execution (PS 2.0, PowerCLI 5, etc.), hence feedback to managers that "The script doesn't work".  Very fun conversations come out of those...  Smiley Wink

I thought of three different approaches to this issue and would appreciate your thought in vetting them:

  1. Centralized management server - Accessible by RDP, it would allow me to have the environment pre-configured ahead of time.  The risk would be another engineer mucking with a script of the configuration and there is the two connection limit, so this is not preferred.
  2. A web server with PowerCLI installed - I like the thought of a simple webpage where they select what script to execute, have an additional field to supply parameters and press Submit.  As some of the scripts take a while to execute, emailing the results would be handy.  This is nice as it keeps "cooks out of the kitchen" and allows me to keep the environment / scripts pristine.
  3. An email-based ingress PowerCLI server - Users would have a pre-defined syntax to send the message with that specifies what script and parameters to execute.  As results become available, the output is emailed back to them.  I do not prefer this option as a separate list of what scripts are available and how to feed them would have to be maintained, but it beats #1.

Any thoughts on how to tackle this would be greatly appreciated.  I've done some searching around but never ran across a solution to this problem.

Thanks!

Tags (2)
Reply
0 Kudos
3 Replies
aerodevil
Hot Shot
Hot Shot

Definitely some tough issues there and great that everyone's working on using PowerCLI.  I can try to address some of these things based on experience and tools I'm aware of.  I'm currently working on a similar problem with a growing script repository for a very large virtual environment and team.

1. We have 2 servers that we use to run PowerCLI/PowerShell scripts.  Servers are used for running scheduled tasks and allowing admins to connect when running scripts for changes.  These servers are lightweight and usually only have PowerShell, PowerCLI, and PowerGUI installed.  My fellow main scripter and I are currently working on making most of our scripts write restricted by implementing some user interaction where possible to minimize changes.  We also copy change related scripts into a specific directory so that the originals do not need to be touched.

2. I think this could be addressed with the setup above to some degree but it would depend on where you want the scripts to be run from.  I know that Quest's PowerGUI product has a MobileShell that can help with this as well. http://www.quest.com/PowerGUIPro/mobileshell.aspx

While it does not help you currently, PowerShell 3 should provide some functionality for you with it's PowerShell Web Access in the upcoming Windows Server release. http://blog.powershell.no/2011/09/14/windows-powershell-web-access/

3. This is an interesting idea.  The code on that itself could be harrowing.  The list could be done dynamically with PowerShell of course but you'd have to have a predefined naming/directory structure.  I have been working on the following structure in our environment and it has worked pretty well so far.  We may be scaling down the subdirectories and do that separation based on filename but that is TBD on our side.  Our biggest push is to have a specific directory on a shared drive that admins can access their own copies of the scripts they need without affecting the originals.  It's another option for you.  Here's the rightup on the structure we're trying and I'm happy to answer further questions. http://www.vtesseract.com/post/7368244489/managing-powercli-scripts-file-structure

I'm sure you'll get some further feedback from others and we'll both learn some other techniques.  Good community here.  Hope this helps.

Josh Atwell @Josh_Atwell http://www.vtesseract.com http://github.com/joshatwell/
LucD
Leadership
Leadership

Just my 2¢ for option 2), you could have a look at PowerShell ASP or PowerShell Server V5.

Both offer remote access to a controlled interface where users can start scripts.

A thought outside your 3 options, why don't you try to use PowerShell Remoting.

You could set up the scripts on your central server and allow your engineers to use remote sessions to start these scripts.

With the proper access right on the central server, the engineers would be able to start the script but not change them.


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

Reply
0 Kudos
aerodevil
Hot Shot
Hot Shot

I will be looking into those as well.  Had a feeling I'd learn about something new also. Smiley Happy  Thanks Luc

Josh Atwell @Josh_Atwell http://www.vtesseract.com http://github.com/joshatwell/
Reply
0 Kudos