PowerShell Basics

Unlocking the new Power in the Microsoft Shell
July 16th, 2008

Using PowershellASP

There is a new toy out in the PowerShell Community - PowerShellASP.

You can find the description on the website, but there has been some question as to how to get it working.

The easiest way I’ve found is to work off the demo provided, where the web.config

file is all set up. 

What you need to do for IIS 6, is:

    CreateApplication
  • Update the configuration

UpdateConfiguration

  • Add the ps1x extension and the executable of “C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\aspnet_isapi.dll”

AddExtension

  • (If you are using the sample files this is done already) Update the web.config file with
  • <httpHandlers>
                <add verb=”*” path=”*.ps1x” type=”PowerShellToys.PowerShellASP.PSHandler, PowerShellToys.PowerShellASP”/>
            </httpHandlers>

    And you should be ready to run PowerShellASP pages.

8 Responses to “Using PowershellASP”

  1. […] at PowerShell Basics wrote a post about how to write ASP pages using […]

  2. Damian Flynn Says:
    July 29th, 2008 at 1:41 pm

    Can we add snapins? so that we can use exchange? i have not being able to find examples

  3. I would assume that you could load any snap-in that is available on the server. If you have the Exchange snap-in (and I have not yet installed Exchange 2007, so I’m not sure how easy it is to install the management tools on other servers/workstations).
    I’ll try out loading other snapins that I have available.

  4. Mail Queue Monitor

    body,td,th { font-family: Arial, Helvetica, sans-serif; font-size: 14px; }
    h1 { font-size: 26px; color: #0B4982; }
    #left { float:left; margin:1px; width:100px; 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; }

    Mail Queues

    Mail queues:

    <a href=’?d=’>

    Message/s queued on server

    Fromaddress
    Status
    Queue
    Subject
    Lasterror
    SourceIP
    Size

  5. So any word on the code to add the exchange snap-in, I have powershellasp running and it is great, but being new I cannot figure out the code to add the Exchange Snap in to the code. I would love to be able to run exchange commnads via this especially for those NON IE users to get quota information….


  6. “”

  7. You can execute the following PowerShell command to add the Exchange snapin.

    add-pssnapin *.Exchange*

    Note that the system you are executing from needs to already have the Exchange Management Tools installed for this to work.

Leave a Reply