Windows Vista Forums
Vista Forums Home Join Vista Forums Windows 7 Forum Vista Tutorials Tags
Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks.

Go Back   Vista Forums > Misc Newsgroups > PowerShell

Vista - Execute a powershell script from a webpage

Reply
 
Old 09-09-2008   #1 (permalink)
BZP


 
 

Execute a powershell script from a webpage

Hello,

I wonder if it is possible to execute a powershell script and show the
result in a the page from a IIS website (6.0 on a W2003 R2 Ent SP2).

Thanks for your help.

--
P.J.A.

My System SpecsSystem Spec
Old 09-09-2008   #2 (permalink)
Hal Rottenberg


 
 

Re: Execute a powershell script from a webpage

BZP wrote:
Quote:

> I wonder if it is possible to execute a powershell script and show the
> result in a the page from a IIS website (6.0 on a W2003 R2 Ent SP2).
Check out PowershellASP and PoshBoard

http://powershelltoys.com/
http://www.codeplex.com/Poshboard

Also, we talk about this subject on Episode 34, and in Episode 36, we interview
a guy from /n software, the guys who created PowersShellASP.

http://powerscripting.wordpress.com/?s=powershellasp

--
Author, Tech Prosaic blog (http://halr9000.com)
Webmaster, Psi (http://psi-im.org)
Community Director, PowerShellCommunity.org
Co-host, PowerScripting Podcast (http://powerscripting.net)
My System SpecsSystem Spec
Old 09-09-2008   #3 (permalink)
BZP


 
 

Re: Execute a powershell script from a webpage

Thanks, PowerShellASP is great !

Regards,

--
P.J.A.
My System SpecsSystem Spec
Old 09-22-2008   #4 (permalink)
kjhoff123


 
 

RE: Execute a powershell script from a webpage

I configured PowerShellASP, does anyone have any idea on how to add the
Exchange Snap in to this tool? I haven't found anything online and am not a
programmer. But this would be a great tool especially for those non IE users
that need to see their exchange quota?

"BZP" wrote:
Quote:

> Hello,
>
> I wonder if it is possible to execute a powershell script and show the
> result in a the page from a IIS website (6.0 on a W2003 R2 Ent SP2).
>
> Thanks for your help.
>
> --
> P.J.A.
>
My System SpecsSystem Spec
Old 09-22-2008   #5 (permalink)
Karl Mitschke


 
 

RE: Execute a powershell script from a webpage

Hello kjhoff123,
Quote:

> I configured PowerShellASP, does anyone have any idea on how to add
> the Exchange Snap in to this tool? I haven't found anything online and
> am not a programmer. But this would be a great tool especially for
> those non IE users that need to see their exchange quota?
>
> "BZP" wrote:
>
Quote:

>> Hello,
>>
>> I wonder if it is possible to execute a powershell script and show
>> the result in a the page from a IIS website (6.0 on a W2003 R2 Ent
>> SP2).
>>
>> Thanks for your help.
>>
>> --
>> P.J.A.
I am just starting to rewrite my ASP poages that use C# and powershell to
use powershellASP.

To add the Exchange snappin, do this:

<% add-pssnapin *exchange* %>

The web page will have to run in an application pool that is configured wtih
an account that hads the proper exchange permissions to gather the data that
you weant to return to the user.

Then, try this:

<head>
<style>
body,td,th { font-family: Arial, Helvetica, sans-serif; font-size:
14px; }
h1 { font-size: 26px; color: #0B4982; }
#left { float:left; margin:10px; width:180px; border:1px
solid gainsboro;font-weight:bold}
#left P { border-bottom:1px solid gainsboro;padding:4px;
margin-bottom:2px;margin-top:2px; }
#left UL { margin:2px; padding:0px; }
#left LI { list-style: none; margin:4px; }
</style>
</head>
<body>
<% add-pssnapin *exchange* %>
<% $mailboxname = $request['logon_user'].split("\")[1]%>
<% get-mailboxfolderstatistics $mailboxname | ft FolderPath, ItemsInFolder,
@{Label="FolderSize(MB)";expression={$_.FolderSize.ToMB()} } -auto %>
</body>


You will have toi fornat the results to your liking


My System SpecsSystem Spec
Old 09-22-2008   #6 (permalink)
Karl Mitschke


 
 

RE: Execute a powershell script from a webpage

Hello kjhoff123,
Quote:

> I configured PowerShellASP, does anyone have any idea on how to add
> the Exchange Snap in to this tool? I haven't found anything online and
> am not a programmer. But this would be a great tool especially for
> those non IE users that need to see their exchange quota?
>
> "BZP" wrote:
>
Quote:

>> Hello,
>>
>> I wonder if it is possible to execute a powershell script and show
>> the result in a the page from a IIS website (6.0 on a W2003 R2 Ent
>> SP2).
>>
>> Thanks for your help.
>>
>> --
>> P.J.A.
My earlier reply was all sorts of ugly

I am just starting to rewrite my ASP poages that use C# and powershell to
use powershellASP.

To add the Exchange snappin, do this:

<% add-pssnapin *exchange* %>

The web page will have to run in an application pool that is configured wtih
an account that hads the proper exchange permissions to gather the data that
you weant to return to the user.

Then, try this:


<body>
<% add-pssnapin *exchange* %>
<% $mailboxname = $request['logon_user'].split("\")[1]%>
<% get-mailboxfolderstatistics $mailboxname | ft FolderPath, ItemsInFolder,
@{Label="FolderSize(MB)";expression={$_.FolderSize.ToMB()} } -auto %>
</body>


My System SpecsSystem Spec
Old 09-23-2008   #7 (permalink)
kjhoff123


 
 

RE: Execute a powershell script from a webpage

Thanks for everyones help, the Application Pool running in a user that had
the rights was the issues I was having. By putting in the Exchange Admin Snap
in is the PS1 file works perfectly. Thanks again!

"BZP" wrote:
Quote:

> Hello,
>
> I wonder if it is possible to execute a powershell script and show the
> result in a the page from a IIS website (6.0 on a W2003 R2 Ent SP2).
>
> Thanks for your help.
>
> --
> P.J.A.
>
My System SpecsSystem Spec
Old 01-13-2009   #8 (permalink)
Jan Aarts


 
 

Execute a powershell script from a webpage

kjhoff12

can you share more details?

I want to do the same

EggHeadCafe - .NET Developer Portal of Choice
http://www.eggheadcafe.com/default.aspx?ref=ng
My System SpecsSystem Spec
Reply

Thread Tools


Similar Threads
Thread Forum
Permissions to execute the script VB Script
powershell script to execute simultaneously instead of sequentially PowerShell
execute Exchange script from DOS - how to get result? PowerShell
Powershell Execute process PowerShell
execute powershell script from commmand line PowerShell


Vista Forums is an independent web site and has not been authorized,
sponsored, or otherwise approved by Microsoft Corporation.
"Windows Vista", the Start Orb, and related materials are trademarks of Microsoft Corp.
© Designer Media Ltd

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46