« Previous Next »

Thread: IIS provider and PowerShell remoting

Last post 05-10-2009 9:11 AM by rsiddaw. 5 replies.

Average Rating Rate It (5)

RSS

Page 1 of 1 (6 items)

Sort Posts:

  • 02-07-2009, 11:37 AM

    • rsiddaw
    • Not Ranked
    • Joined on 07-03-2008, 4:09 PM
    • Posts 12

    IIS provider and PowerShell remoting

    if I use get-website on an IIS machine everythign works fine.  If I want to use the remoting capability in PowerShell v2 I get an error.  I have PS v2 CTP 3 installed on client and IIS machine.

    PS> Invoke-Command -Session $rsweb1 -ScriptBlock { Get-WebSite }


    name               : Default Web Site
    id                 : 1
    serverAutoStart    : True
    state              : Started
    bindings           : Microsoft.IIs.PowerShell.Framework.ConfigurationElement
    PSComputerName     : web01
    RunspaceId         : f00a8440-0607-40fe-84d6-d1103a90e25b
    PSShowComputerName : True
    Attributes         : {Microsoft.IIs.PowerShell.Framework.ConfigurationAttribute, Microsoft.IIs.PowerShell.Framework.Con
                         figurationAttribute, Microsoft.IIs.PowerShell.Framework.ConfigurationAttribute, Microsoft.IIs.Powe
                         rShell.Framework.ConfigurationAttribute}
    ChildElements      : {Microsoft.IIs.PowerShell.Framework.ConfigurationElement Microsoft.IIs.PowerShell.Framework.Config
                         urationElement Microsoft.IIs.PowerShell.Framework.ConfigurationElement Microsoft.IIs.PowerShell.Fr
                         amework.ConfigurationElement Microsoft.IIs.PowerShell.Framework.ConfigurationElement, Microsoft.II
                         s.PowerShell.Framework.ConfigurationElement, Microsoft.IIs.PowerShell.Framework.ConfigurationEleme
                         nt, Microsoft.IIs.PowerShell.Framework.ConfigurationElement...}
    ElementTagName     : site
    Methods            : {Microsoft.IIs.PowerShell.Framework.ConfigurationMethod, Microsoft.IIs.PowerShell.Framework.Config
                         urationMethod}
    Schema             : Microsoft.IIs.PowerShell.Framework.ConfigurationElementSchema

    Invoke-Command : The data is invalid. (Exception from HRESULT: 0x8007000D)
    At line:1 char:15
    + Invoke-Command <<<<  -Session $rsweb1 -ScriptBlock { Get-WebSite }
        + CategoryInfo          : NotSpecified: (:) [Get-Website], COMException
        + FullyQualifiedErrorId : System.Runtime.InteropServices.COMException,Microsoft.IIs.PowerShell.Provider.GetWebsite
       Command

    If I use

    PS> Invoke-Command -Session $rsweb1 -ScriptBlock { Get-WebSite | Format-table }

    Name             ID   State      Physical Path                  Bindings
    ----             --   -----      -------------                  --------
    Default Web Site 1    Started    %SystemDrive%\inetpub\wwwroot  http *:80:
                                                                    net.tcp 808:*
                                                                    net.pipe *
                                                                    net.msmq localhost
                                                                    msmq.formatname localhost

     

    the results are OK

    I getthe same error with

    Invoke-Command -Session $rsweb1 -ScriptBlock { Get-ChildItem iis:\sites }

     

    Richard Siddaway
    Powershell MVP
    http://richardsiddaway.spaces.live.com/
  • 02-08-2009, 2:15 PM In reply to

    Re: IIS provider and PowerShell remoting

    Let me see if I can get a hold of someone on the IIS team.

    Steve Schofield
    Windows Server MVP - IIS
    http://weblogs.asp.net/steveschofield


    http://www.IISLogs.com
    Log archival solution
    Install, Configure, Forget
  • 02-23-2009, 3:55 AM In reply to

    • sergeia
    • Top 100 Contributor
    • Joined on 04-14-2008, 4:47 PM
    • Posts 68

    Re: IIS provider and PowerShell remoting

    Hi, Richard!

     

    Which release of IIS snapin are you using? Is it CTP2 or RC?

    I assume that this command works correctly when you run it on server locally, right?

     

    Thanks,

    Sergei

  • 02-23-2009, 8:39 AM In reply to

    • rsiddaw
    • Not Ranked
    • Joined on 07-03-2008, 4:09 PM
    • Posts 12

    Re: IIS provider and PowerShell remoting

    I am using the RC download on Windows 2008 RTM

    Richard Siddaway
    Powershell MVP
    http://richardsiddaway.spaces.live.com/
  • 03-10-2009, 1:01 AM In reply to

    • sergeia
    • Top 100 Contributor
    • Joined on 04-14-2008, 4:47 PM
    • Posts 68

    Re: IIS provider and PowerShell remoting

    Richard, I finally set up remoting and could take a look, what is going on.

    On my machine I am also getting similar problem, error is different, but nature, I believe is the same. I think it is an issue with rendering of some property. Do you have format.ps1xml and types.ps1xml from IIS snapin on your client machine? It seems that Powershell sends only objects remotely, and render them using available templates. When I loaded format and types on remote client, my error is gone. Could you try this?

    --Sergei 

     

  • 05-10-2009, 9:11 AM In reply to

    • rsiddaw
    • Not Ranked
    • Joined on 07-03-2008, 4:09 PM
    • Posts 12

    Re: IIS provider and PowerShell remoting

    No copying the type and format files and loading them, even as a prepend has not solved the problem.  I still need to pipe into format-table to get the data.  If I don't error message is as before

    Richard Siddaway
    Powershell MVP
    http://richardsiddaway.spaces.live.com/
Page 1 of 1 (6 items)
Microsoft Communities