Previous Next

Thread: PowerShell Provider for IIS7

Last post 04-16-2008 1:15 PM by JeongHwan. 18 replies.

Average Rating Rate It (5)

RSS

Page 1 of 2 (19 items) 1 2 Next >

Sort Posts:

  • 04-14-2008, 5:57 PM

    • thomad
    • Top 25 Contributor
    • Joined on 08-20-2002, 3:28 PM
    • Redmond
    • Posts 387

    PowerShell Provider for IIS7

    PS IIS7 

    The IIS 7.0 PowerShell Provider is ready for you:  

    It allows you to
    • Create Web-Sites, Web Applications, Virtual Directories and Application Pools
    • Change Simple Configuration Properties on Web-Sites, Application Pools, Web Applications and Virtual Directories
    • Add and Change Complex Configuration Settings
    • Query Run-time Data (Web-Site State, Application Pool State, Currently Executing Requests)
    • Execute Advanced Configuration Tasks, Scripting, Integration with other PowerShell Snap-Ins and features
    • Search and Discover Configuration Settings

    DOWNLOAD:
    Tech Preview 1 of the IIS 7.0 PowerShell Provider can be found here:
    x86: http://www.iis.net/downloads/1664/ItemPermaLink.ashx
    x64: http://www.iis.net/downloads/1665/ItemPermaLink.ashx

    FORUMS:
    Go to our PowerShell forum if you need support or if you are looking for 'Tips and Tricks'
    http://forums.iis.net/1151.aspx
     

     

    WALKTHROUGHS:
    We have 9 walkthroughs for you to get familiar with the IIS 7.0 PowerShell Provider:
    http://learn.iis.net/page.aspx/447/managing-iis-with-the-iis-70-powershell-provider/

     

    Thomas Deml
    Senior Program Manager
    Internet Information Services
    Microsoft Corp.
  • 04-14-2008, 6:04 PM In reply to

    • JeongHwan
    • Top 150 Contributor
    • Joined on 12-14-2004, 11:43 AM
    • Redmond, WA
    • Posts 19

    Re: PowerShell Provider for IIS7

    The IIS 7.0 PowerShell Provider requires the following prerequisites:

    • Windows Server 2008 or Windows Vista Service Pack 1
    • Microsoft PowerShell 1.

    NOTE:

    You should use administrator user account. When you use non-admin account, you will see empty result from IIS:\Sites and IIS:\AppPools locations. Only administrator are allowed to read/write IIS configuration using IIS Powershell Provider. There is no delegation feature yet in this Tech Review 1 version.

    Jeong Hwan Kim
  • 04-14-2008, 7:37 PM In reply to

    Re: PowerShell Provider for IIS7

    Great... Finally we have PowerShell integration with IIS 7

    Installed and ready to go...

    Had a quick hiccup though ... I wanted to get-item for the default web site and this is what it gave me

    Get-Item : A parameter cannot be found that matches parameter name 'Web'.
    At line:1 char:9
    + get-item  <<<< iis:\sites\Default Web site

     Although then realized that this would work perfectly instead ... :)

    PS IIS:\> get-item "iis:\sites\Default Web site" 

    Just something for the starters ...
    ;)

     

    Regards,
    MA Khan
    http://www.iisworkstation.com

    “Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread. ”
  • 04-14-2008, 7:50 PM In reply to

    • JeongHwan
    • Top 150 Contributor
    • Joined on 12-14-2004, 11:43 AM
    • Redmond, WA
    • Posts 19

    Re: PowerShell Provider for IIS7

    Oh, you tried to execute the get-item without using the double (or single) quotation mark for the -pspath parameter value of "Default Web Site" and you have showed the right way in your comment above. Yeah, it was a common mistake I did also when I was testing IIS Powershell Cmdlets. The double(or single) quotation mark should be used if the parameter value contains space characters in it as we do in DOS prompt.

    Jeong Hwan Kim
  • 04-15-2008, 9:27 AM In reply to

    Re: PowerShell Provider for IIS7

    This is great stuff, guys! :-)

    One question; is it possible to install the IIS7 provider separately so that I can do add-pssnapin in my profile.ps1 and have the IIS 7 stuff available in my usual shell?  I do a lot of work with IIS 7 and don't really want to have to use a separate shell to access the IIS cmdlets.

    Many thanks

    Alastair
     

  • 04-15-2008, 11:25 AM In reply to

    • thomad
    • Top 25 Contributor
    • Joined on 08-20-2002, 3:28 PM
    • Redmond
    • Posts 387

    Re: PowerShell Provider for IIS7

    Alastair,

    No problem. "add-pssnapin -name IIsProviderSnapIn" should do the trick.

     

    Thomas Deml
    Senior Program Manager
    Internet Information Services
    Microsoft Corp.
  • 04-15-2008, 11:46 AM In reply to

    Re: PowerShell Provider for IIS7

    Thomas,

    Thanks for your reply.  Unfortunately, that doesn't seem to work for me:

    PS C:\Perforce\caxton_core\src> add-pssnapin -name IIsProviderSnapIn
    Add-PSSnapin : Windows PowerShell snap-in IIsProviderSnapIn is not installed on the machine.
    At line:1 char:13
    + add-pssnapin  <<<< -name IIsProviderSnapIn

    Would a reboot be required after installation to allow this to work?

    Cheers

    Alastair
     

  • 04-15-2008, 12:23 PM In reply to

    • thomad
    • Top 25 Contributor
    • Joined on 08-20-2002, 3:28 PM
    • Redmond
    • Posts 387

    Re: PowerShell Provider for IIS7

    Weird, this works great for me. What does the following report:

    get-itemproperty HKLM:\SOFTWARE\Microsoft\PowerShell\1\PowerShellSnapIns\IIsProviderSnapIn

     

     

    Thomas Deml
    Senior Program Manager
    Internet Information Services
    Microsoft Corp.
  • 04-15-2008, 12:30 PM In reply to

    Re: PowerShell Provider for IIS7

    Erm, weirdly, the same again:
    PS C:\Perforce\caxton_core\src> get-itemproperty HKLM:\SOFTWARE\Microsoft\PowerShell\1\PowerShellSnapIns\IIsProviderSnap
    In
    Get-ItemProperty : Cannot find path 'HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\PowerShell\1\PowerShellSnapIns\IIsProviderSn
    apIn' because it does not exist.
    At line:1 char:17
    + get-itemproperty  <<<< HKLM:\SOFTWARE\Microsoft\PowerShell\1\PowerShellSnapIns\IIsProviderSnapIn

    Hope that helps?

    Alastair
     

  • 04-15-2008, 12:37 PM In reply to

    Re: PowerShell Provider for IIS7

    gonna ask you a weird question .... but have you installed the IIS provider that came in the msi package? because for me too it worked just fine.... probably if you have already done that ... then can you pass on some config specifics....  and this will be output for the get-itemproperty

    PS C:\Users\Administrator> get-itemproperty HKLM:\SOFTWARE\Microsoft\PowerShell\1\PowerShellSnapIns\IIsProviderSnapIn

    PSPath            : Microsoft.PowerShell.Core\Registry::HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\PowerShell\1\PowerShellSn
                        apIns\IIsProviderSnapIn
    PSParentPath      : Microsoft.PowerShell.Core\Registry::HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\PowerShell\1\PowerShellSn
                        apIns
    PSChildName       : IIsProviderSnapIn
    PSDrive           : HKLM
    PSProvider        : Microsoft.PowerShell.Core\Registry
    ApplicationBase   : C:\Program Files\IIS\PowerShellProvider\
    AssemblyName      : IIsProvider,version="7.1.0.0",culture="neutral",publicKeyToken="xxxxxxxxxxxx",processorArchitec
                        ture="MSIL"
    ModuleName        : iisprovider.dll
    PowerShellVersion : 1.0
    Description       : IIS Administration Provider
    Types             : {iisprovider.types.ps1xml}
    Formats           : {iisprovider.format.ps1xml}

    Regards,
    MA Khan
    http://www.iisworkstation.com

    “Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread. ”
  • 04-15-2008, 12:50 PM In reply to

    Re: PowerShell Provider for IIS7

    Yes, I just downloaded the MSI (x64 version) and installed as usual.  I'm running Vista x64 SP1, and I'm running the 64-bit version of PowerShell.  I've got other PSSnapIns installed (PSCX, and a couple of my own custom ones) that all run fine. 

    Is there any more information I can provide? 

  • 04-15-2008, 1:35 PM In reply to

    Re: PowerShell Provider for IIS7

    Alastair ,

        Are you running PowerShell with Admin privileges?? To try out our scenario I tried out a little thing... I ran PowerShell with a user of non-admin privilege and did a add-pssnapin for the IIS provider ... it gave me the warning and everything cool till now... but then when I ran get-item for the IIS default website ...It returned me the same error as yours and then I ran the same with admin privilege and everything was great and happy life again... :) .... Hope this helps..
    PowerShell IIS 7 provider
     

    Regards,
    MA Khan
    http://www.iisworkstation.com

    “Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread. ”
  • 04-15-2008, 4:35 PM In reply to

    • JeongHwan
    • Top 150 Contributor
    • Joined on 12-14-2004, 11:43 AM
    • Redmond, WA
    • Posts 19

    Re: PowerShell Provider for IIS7

    ma_khan is right. We should use administrator account for IIS Powershell Provider.

    Jeong Hwan Kim
  • 04-15-2008, 5:21 PM In reply to

    Re: PowerShell Provider for IIS7

    Unfortunately that hasn't fixed it :-(  Changed my account to Admin (was "Debugging User" previously, presumably thanks to Visual Studio), logged off, logged on again, fired up PowerShell and...  Same error

    I don't get this at all; add-pssnapin does the same thing as the supplied psc1 script (presumably in a slightly different way, though), and that works fine, no problems. 

  • 04-15-2008, 5:39 PM In reply to

    Re: PowerShell Provider for IIS7

    Another oddity I've noticed after poking around in the MSI is that the provider DLL doesn't appear to have copied somehow.  There is no file in the directory C:\Program Files\IIS\PowerShellProvider called iisprovider.dll.  I show hidden files by default, and not even displaying protected operating system files brings up an iisprovider.dll in that location.  Additionally, as already found by the get-itemproperty example, the registry actions aren't being performed either. 

    Which all sort of begs the question, how is it working at all?!? :-)

Page 1 of 2 (19 items) 1 2 Next >
Page view counter