An example would be something like: http://127.0.0.1:8080/ps?command=$pshome
which would return: C:\WINDOWS\system32\WindowsPowerShell\v1.0
Thanks!
Why would you want to do this? Or more specifically... what is your goal.
<michae...@gmail.com> wrote in message
news:1180663957....@q66g2000hsg.googlegroups.com...
The goal is utimately to remotely execute a PowerShell scripts from a
simple url request rather than a just an API. In the past, this was
not safe because of security issues. However, because PowerShell has
a security layer built-in, it would now be of great use. Imagine
writing a signed PowerShell script which could return data from a
legacy system. This would be a very powerful and flexiable tool.
That said, if your goal is to collect data from all the "clients" via a
webpage then you will have to have powershell installed on all of them. If
that is indeed your intention actually you do not have to write server side
code... you could write a client side vb/jscript to call powershell with the
script as parameter and post the results.
p.s. I want to clarify.. I think WMI is your best bet, but wanted to give
the info you asked for.
"RichS" <Ri...@discussions.microsoft.com> wrote in message
news:B979A5A2-75A6-4795...@microsoft.com...
--
William Stacey [C# MVP]
PowerLocker, PowerPad
www.powerlocker.com
<michae...@gmail.com> wrote in message
news:1180663957....@q66g2000hsg.googlegroups.com...
I think this would be great, a really simple way to expose information.
There has to be some way to put the ConvertTo-Html cmdlet to good use.
If I was going to do it, I think I would look at writing a Web Service
Extension. It would also be interesting to look into creating an ASP.NET
control that executes a PowerShell script so you could drop the output of a
script into an ASP.NET page.
I've blogged about 2 methods
Method 1 creates an actual HTTP Listener so powershell scripts can be executed from remote computers
HTTPowerShell
http://whizzrd.spaces.live.com/blog/cns!36AFCF1E860E662E!166.entry
Method 2 creates a custom protocol prefix and allows you to invoke powershell commands via url's on the local computer only
PowerShell URL Protocol
http://whizzrd.spaces.live.com/blog/cns!36AFCF1E860E662E!171.entry
--
Joris van Lier
Please note that all code and opinions are supplied "as is" and with no warranty
Blog: http://whizzrd.spaces.live.com
Joris,
> --
> Joris van Lier
> Please note that all code and opinions are supplied "as is" and with no warranty
> Blog:http://whizzrd.spaces.live.com
Method 1 is exactly what I am looking for!
Now I would like to output the response in XML format in the browser
(but not save to file).
Since I am new to PowerShell, I have some research to do.
Thanks,