Windows Vista Forums

IIS 6.0 Provider vs Cmdlet

  1. #1


    vhk Guest

    IIS 6.0 Provider vs Cmdlet

    Am fairly new to powershell 1.0 , couple questions regarding the best way to
    use powershell for IIS 6 administration
    1) What is the best way to access IIS metabase using powershell ? do i need
    to go through WMI object adapter ?
    2) Should i write a powershell provider or a cmdlet (or both) to administer
    IIS through powershell ?
    3) Is it possible to write custom Cmdlets specific to the Provider ? if so ,
    how does powershell which Cmdlets are supported by which provider ?

    -Thanks



      My System SpecsSystem Spec

  2. #2


    Shay Levi Guest

    Re: IIS 6.0 Provider vs Cmdlet

    You can manage IIs6 with WMI or ADSI. As far as I know, there is no PowerShell
    IIs provider nor any command-lets.
    Feel more than welcome to write one :-)


    Shay
    http://scriptolog.blogspot.com



    > Am fairly new to powershell 1.0 , couple questions regarding the best
    > way to
    > use powershell for IIS 6 administration
    > 1) What is the best way to access IIS metabase using powershell ? do i
    > need
    > to go through WMI object adapter ?
    > 2) Should i write a powershell provider or a cmdlet (or both) to
    > administer
    > IIS through powershell ?
    > 3) Is it possible to write custom Cmdlets specific to the Provider ?
    > if so ,
    > how does powershell which Cmdlets are supported by which provider ?
    > -Thanks
    >


      My System SpecsSystem Spec

  3. #3


    RichS Guest

    Re: IIS 6.0 Provider vs Cmdlet

    As Shay said there isn't a provider etc

    I would start with scripts & then think about cmdlets once you know how the
    work breaks down
    --
    Richard Siddaway
    Please note that all scripts are supplied "as is" and with no warranty
    Blog: http://richardsiddaway.spaces.live.com/
    PowerShell User Group: http://www.get-psuguk.org.uk


    "Shay Levi" wrote:

    > You can manage IIs6 with WMI or ADSI. As far as I know, there is no PowerShell
    > IIs provider nor any command-lets.
    > Feel more than welcome to write one :-)
    >
    >
    > Shay
    > http://scriptolog.blogspot.com
    >
    >
    >

    > > Am fairly new to powershell 1.0 , couple questions regarding the best
    > > way to
    > > use powershell for IIS 6 administration
    > > 1) What is the best way to access IIS metabase using powershell ? do i
    > > need
    > > to go through WMI object adapter ?
    > > 2) Should i write a powershell provider or a cmdlet (or both) to
    > > administer
    > > IIS through powershell ?
    > > 3) Is it possible to write custom Cmdlets specific to the Provider ?
    > > if so ,
    > > how does powershell which Cmdlets are supported by which provider ?
    > > -Thanks
    > >
    >
    >
    >

      My System SpecsSystem Spec

  4. #4


    Marco Shaw Guest

    Re: IIS 6.0 Provider vs Cmdlet

    vhk wrote:

    > Am fairly new to powershell 1.0 , couple questions regarding the best way to
    > use powershell for IIS 6 administration
    > 1) What is the best way to access IIS metabase using powershell ? do i need
    > to go through WMI object adapter ?
    > 2) Should i write a powershell provider or a cmdlet (or both) to administer
    > IIS through powershell ?
    > 3) Is it possible to write custom Cmdlets specific to the Provider ? if so ,
    > how does powershell which Cmdlets are supported by which provider ?
    >
    > -Thanks
    There are no Microsoft-provided cmdlets for any current version of IIS.

    The IIS guys did post this blog entry on IIS7 though:
    http://www.iis.net//articles/view.as...-lets-for-IIS7

    I have to agree with Richard though, if you're completely new to
    PowerShell, try scripting your stuff first, unless you're a real pro at
    C#/VB.NET.

    Marco

    --
    ----------------
    PowerGadgets MVP
    http://www.powergadgets.com/mvp

    Blog:
    http://marcoshaw.blogspot.com

      My System SpecsSystem Spec

  5. #5


    Marco Shaw Guest

    Re: IIS 6.0 Provider vs Cmdlet

    vhk wrote:

    > Am fairly new to powershell 1.0 , couple questions regarding the best way to
    > use powershell for IIS 6 administration
    > 1) What is the best way to access IIS metabase using powershell ? do i need
    > to go through WMI object adapter ?
    > 2) Should i write a powershell provider or a cmdlet (or both) to administer
    > IIS through powershell ?
    > 3) Is it possible to write custom Cmdlets specific to the Provider ? if so ,
    > how does powershell which Cmdlets are supported by which provider ?
    >
    > -Thanks
    TechNet Webcast: Automating Internet Information Services 7.0
    (Level 300)
    Thursday, October 25, 2007 9:30 AM Pacific Time (US & Canada)

    http://go.microsoft.com/?linkid=7415083

    Marco

    --
    ----------------
    PowerGadgets MVP
    http://www.powergadgets.com/mvp

    Blog:
    http://marcoshaw.blogspot.com

      My System SpecsSystem Spec

  6. #6


    Marco Shaw Guest

    Re: IIS 6.0 Provider vs Cmdlet

    vhk wrote:

    > Am fairly new to powershell 1.0 , couple questions regarding the best way to
    > use powershell for IIS 6 administration
    > 1) What is the best way to access IIS metabase using powershell ? do i need
    > to go through WMI object adapter ?
    > 2) Should i write a powershell provider or a cmdlet (or both) to administer
    > IIS through powershell ?
    > 3) Is it possible to write custom Cmdlets specific to the Provider ? if so ,
    > how does powershell which Cmdlets are supported by which provider ?
    >
    > -Thanks
    Just noticed this too:
    http://blogs.iis.net/bills/archive/2...ell-rocks.aspx

    The comments have some links I don't think I've seen before.

    --
    ----------------
    PowerGadgets MVP
    http://www.powergadgets.com/mvp

    Blog:
    http://marcoshaw.blogspot.com

      My System SpecsSystem Spec

  7. #7


    Flowering Weeds Guest

    Re: IIS 6.0 Provider vs Cmdlet


    "vhk"

    > Am fairly new to powershell 1.0 ,
    > couple questions regarding the
    > best way to use powershell for
    > IIS 6 administration
    Mmm is one asking for too much in one post?

    But perhaps the below objects will allow one
    to slowly start to get a ton of information from
    IIS (metabase too) or other web servers, or
    databases or even simple (or very complex)
    queries for other type of businesses too.

    For example cafe cooks:

    Show in either text or chart output,
    to the cooks
    on a screen in the kitchen,
    just what veg or drink is ordered
    the most often
    with what meat or fish!

    Yep plain old data parsing, no matter
    what the business is! Same idea and
    objects used for one's IIS servers!

    And if the cooks
    (just like network admins),
    get this information as soon as
    the information is in the system,
    then the cooks too,
    have a real-time data monitoring system,
    that displays output to those always on
    (control room screens) or here the screen
    used by the cooks. And all this with a few
    every day objects!

    First the main control object:

    Microsoft's Windows PowerShell
    (Controls what data to get and how
    to display it.)

    Second the data workers:

    For IIS and many others perhaps
    Microsoft's Log Parser 2.2
    (parses data) whether for the cafe's
    nightly information or accessing many
    IIS servers or remote AD or whatever.
    Sure PowerShell itself can be the data
    worker.

    Third the report makers:

    Yes one can use PowerShell to
    create the text based reports or
    use Log Parser's built-in output
    formats. Including Log Parser's
    chart output or the placing of the
    parsed data into Log Parser's user
    created pre-prepared output files (HTML,
    etc.). Log Parser fills in the pre-defined
    blank spots, with the newly obtained
    parsed data, right into the file or
    database!

    Oh and by the way, for it's chart output,
    Log Parser is just using Microsoft's
    ChartSpace objects (commonly called
    Excel Charting). Yes, after learning the
    ChartSpace objects usage, PowerShell
    itself can call these objects and make
    charts too!

    And finally the report viewers:
    (Of course paper copies too)

    Microsoft's PowerShell Console
    Microsoft's Internet Explorer
    Microsoft's Http Application (HTA)
    Microsoft's Gadgets
    Microsoft's .NET Framework Forms

    Perhaps an example of using PowerShell
    as the "controller" and data parser, to get
    some process information ( instead of an
    IIS example, so all can follow along). And
    then passing the data to Log Parser,
    used as both a data parser and a report
    maker (with it's chart output), and finally,
    the report viewing part, IE to see the chart.

    Start example:

    get-wmiobject win32_process |
    where-object { $_.Name -match "pow" } |
    select-object ProcessId, ThreadCount |
    LogParser.exe "SELECT field1 AS PID, `
    field2 AS ThreadCount `
    INTO pieChartThreadCounts.gif `
    FROM STDIN " `
    -i:tsv -headerRowff -nSkipLines:3 `
    -nFields:2 -iSeparator:"space" -qn `
    -o:chart -chartType:PieExploded `
    -categoriesff -valuesn -viewff `
    -chartTitle:"PowerShell`nThread Counts"

    $ie7 = new-object -COM InternetExplorer.Application
    $ie7.Navigate2("file://$pwd\pieChartThreadCounts.gif")
    $ie7.Visible = $true

    End example.

    In the above Log Parser is using the
    TSV input format -skipping lines and
    creating space defined fields and then
    producing chart output. If one changes
    the -viewff to -viewn then Log
    Parser, besides making and saving the
    chart, will also display the chart.

    So with the everyday Windows objects
    usage shown above, one can just start
    slowly with one's IIS (or cafe) data parsing
    and viewing queries. Perhaps search the
    internet for other IIS Log Parser examples
    (or whatever type of data parsing needs).

    Perhaps post one's IIS (and other) examples
    too.

    Then (after trying to make it work), ask here,
    one point at a time questions, that perhaps the
    other PowerShell users can answer for you.

    Good Luck




      My System SpecsSystem Spec

  8. #8


    vhk Guest

    Re: IIS 6.0 Provider vs Cmdlet

    Thanks , I did get the basic cmdlets working based on Sergei Antonov's
    article , but cmdlets seem to be a bit too verbose for basic iis
    administration tasks , writing a provider which lets you traverse the iis
    metabase seems to be more natural . I have gotten so far as to register an
    IISProvider
    and create a new PS drive which points to a remote IIS webserver using WMI
    adapter . but when i try to do a Set-Location <iisdrive> it bombs , saying
    that the provider does not support the operation . Is this even possible in
    powershell ?







    "Marco Shaw" wrote:

    > vhk wrote:

    > > Am fairly new to powershell 1.0 , couple questions regarding the best way to
    > > use powershell for IIS 6 administration
    > > 1) What is the best way to access IIS metabase using powershell ? do i need
    > > to go through WMI object adapter ?
    > > 2) Should i write a powershell provider or a cmdlet (or both) to administer
    > > IIS through powershell ?
    > > 3) Is it possible to write custom Cmdlets specific to the Provider ? if so ,
    > > how does powershell which Cmdlets are supported by which provider ?
    > >
    > > -Thanks
    >
    > Just noticed this too:
    > http://blogs.iis.net/bills/archive/2...ell-rocks.aspx
    >
    > The comments have some links I don't think I've seen before.
    >
    > --
    > ----------------
    > PowerGadgets MVP
    > http://www.powergadgets.com/mvp
    >
    > Blog:
    > http://marcoshaw.blogspot.com
    >

      My System SpecsSystem Spec

  9. #9


    Marco Shaw Guest

    Re: IIS 6.0 Provider vs Cmdlet

    vhk wrote:

    > Thanks , I did get the basic cmdlets working based on Sergei Antonov's
    > article , but cmdlets seem to be a bit too verbose for basic iis
    > administration tasks , writing a provider which lets you traverse the iis
    > metabase seems to be more natural . I have gotten so far as to register an
    > IISProvider
    > and create a new PS drive which points to a remote IIS webserver using WMI
    > adapter . but when i try to do a Set-Location <iisdrive> it bombs , saying
    > that the provider does not support the operation . Is this even possible in
    > powershell ?
    That's *very* interesting. You have more details on how you tried to
    make that run?

    If the remote machine is accessed via WMI, it *sounds* possible.


    --
    ----------------
    PowerGadgets MVP
    http://www.powergadgets.com/mvp

    Blog:
    http://marcoshaw.blogspot.com

      My System SpecsSystem Spec

  10. #10


    vhk Guest

    Re: IIS 6.0 Provider vs Cmdlet

    After spending a fair amount of time debugging , it turns out i did not
    override the ItemExists method of the ContainerCmdletProvider , which always
    returned false , resulting in the 'provider does not support .. " exception .
    Supposedly you need to override all the following four methods ,
    * GetChildItems
    * GetChildNames
    * ItemExists
    * HasChildItems

    if you are deriving from the ContainerCmdletProvider class to get a
    consistent behavior . I found this piece of information from msdn
    documentation for ContainerCmdletProvider
    http://msdn2.microsoft.com/en-us/lib...tprovider.aspx





    "Marco Shaw" wrote:

    > vhk wrote:

    > > Thanks , I did get the basic cmdlets working based on Sergei Antonov's
    > > article , but cmdlets seem to be a bit too verbose for basic iis
    > > administration tasks , writing a provider which lets you traverse the iis
    > > metabase seems to be more natural . I have gotten so far as to register an
    > > IISProvider
    > > and create a new PS drive which points to a remote IIS webserver using WMI
    > > adapter . but when i try to do a Set-Location <iisdrive> it bombs , saying
    > > that the provider does not support the operation . Is this even possible in
    > > powershell ?
    >
    > That's *very* interesting. You have more details on how you tried to
    > make that run?
    >
    > If the remote machine is accessed via WMI, it *sounds* possible.
    >
    >
    > --
    > ----------------
    > PowerGadgets MVP
    > http://www.powergadgets.com/mvp
    >
    > Blog:
    > http://marcoshaw.blogspot.com
    >

      My System SpecsSystem Spec

Page 1 of 2 12 LastLast
IIS 6.0 Provider vs Cmdlet

Similar Threads
Thread Thread Starter Forum Replies Last Post
What do I type in the POP box and the SMPT box so I can send and receive emails. My service provider is my service provider is insightbb.com Jerry Oswald Vista mail 3 16 Jan 2010
Where/What assembly do you ref for a provider/cmdlet Bob Landau PowerShell 1 20 Jun 2009
Quest AD cmdlet -what is the cmdlet to remove computer object IT Staff PowerShell 2 30 Oct 2008
Invoking Cmdlet Get-Location from cmdlet,cant get Currnt Directory Vikram PowerShell 2 05 Jun 2008
Whether a cmdlet derives from cmdlet or pscmdlet Marco Shaw PowerShell 1 19 Sep 2007