We are excited to announce that the IIS.NET Forums are moving to the new Microsoft Q&A experience. Learn more >

Undefined object type ServerRSS

5 replies

Last post May 17, 2019 07:10 AM by Jalpa Panchal

  • Undefined object type Server

    May 14, 2019 10:06 PM|jvinicius|LINK

    Hi, folks.

    I'm trying to run some PowerShell scripts, like Start-WebAppPool, for a specific server and I got the following error:

    PS C:\Users\xyz> Start-WebAppPool -Name 'abc'
    Start-WebAppPool : Undefined object type Server.
    Parameter name: nodeName
    At line:1 char:1
    + Start-WebAppPool -Name 'abc'
    + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        + CategoryInfo          : InvalidArgument: (:) [Start-WebAppPool], ArgumentException
        + FullyQualifiedErrorId : invalidArgument,Microsoft.IIs.PowerShell.Provider.StartAppPoolCommand

    I have 10 servers and I'm able to run the same command this command in 9 of then. Even when tried to Import-Module WebAdministration it doesn't work.

    Any idea of what's going on?

    Thanks!

  • Re: Undefined object type Server

    May 15, 2019 05:34 AM|Jalpa Panchal|LINK

    Hi,

    Does this user have administrator right? or this user has access to remote iis?

    Regards,

    Jalpa

    .NET forums are moving to a new home on Microsoft Q&A, we encourage you to go to Microsoft Q&A for .NET for posting new questions and get involved today.
  • Re: Undefined object type Server

    May 15, 2019 09:28 PM|jvinicius|LINK

    Hi, Jalpa.

    Yes, I have admin rights and remote access to to IIS.

    Thanks,

  • Re: Undefined object type Server

    May 16, 2019 06:43 AM|Jalpa Panchal|LINK

    Hi,

    Try to use the below steps to start and stop the application pool on the remote server:

    1. Run PowerShell as administrator.
    2. Run command:  Import-Module WebAdministration
    3. Run command: Invoke-Command -ComputerName "REMOTE_SERVER" -ScriptBlock { Start-WebAppPool -Name "apppool name" }

     

    .NET forums are moving to a new home on Microsoft Q&A, we encourage you to go to Microsoft Q&A for .NET for posting new questions and get involved today.
  • Re: Undefined object type Server

    May 16, 2019 01:10 PM|jvinicius|LINK

    Hi, Jalpa.

    I ran the command from other server and I got the same error.

    Thanks,

  • Re: Undefined object type Server

    May 17, 2019 07:10 AM|Jalpa Panchal|LINK

    Hi,

    Does your all server in the same network? also, check that you enable remote management service in IIS.

    .NET forums are moving to a new home on Microsoft Q&A, we encourage you to go to Microsoft Q&A for .NET for posting new questions and get involved today.